Line data Source code
1 : /* Generated by Cython 3.0.11 */
2 :
3 : #ifndef PY_SSIZE_T_CLEAN
4 : #define PY_SSIZE_T_CLEAN
5 : #endif /* PY_SSIZE_T_CLEAN */
6 : #if defined(CYTHON_LIMITED_API) && 0
7 : #ifndef Py_LIMITED_API
8 : #if CYTHON_LIMITED_API+0 > 0x03030000
9 : #define Py_LIMITED_API CYTHON_LIMITED_API
10 : #else
11 : #define Py_LIMITED_API 0x03030000
12 : #endif
13 : #endif
14 : #endif
15 :
16 : #include "Python.h"
17 : #ifndef Py_PYTHON_H
18 : #error Python headers needed to compile C extensions, please install development version of Python.
19 : #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
20 : #error Cython requires Python 2.7+ or Python 3.3+.
21 : #else
22 : #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
23 : #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
24 : #else
25 : #define __PYX_EXTRA_ABI_MODULE_NAME ""
26 : #endif
27 : #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
28 : #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
29 : #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
30 : #define CYTHON_HEX_VERSION 0x03000BF0
31 : #define CYTHON_FUTURE_DIVISION 1
32 : #include <stddef.h>
33 : #ifndef offsetof
34 : #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
35 : #endif
36 : #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
37 : #ifndef __stdcall
38 : #define __stdcall
39 : #endif
40 : #ifndef __cdecl
41 : #define __cdecl
42 : #endif
43 : #ifndef __fastcall
44 : #define __fastcall
45 : #endif
46 : #endif
47 : #ifndef DL_IMPORT
48 : #define DL_IMPORT(t) t
49 : #endif
50 : #ifndef DL_EXPORT
51 : #define DL_EXPORT(t) t
52 : #endif
53 : #define __PYX_COMMA ,
54 : #ifndef HAVE_LONG_LONG
55 : #define HAVE_LONG_LONG
56 : #endif
57 : #ifndef PY_LONG_LONG
58 : #define PY_LONG_LONG LONG_LONG
59 : #endif
60 : #ifndef Py_HUGE_VAL
61 : #define Py_HUGE_VAL HUGE_VAL
62 : #endif
63 : #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
64 : #if defined(GRAALVM_PYTHON)
65 : /* For very preliminary testing purposes. Most variables are set the same as PyPy.
66 : The existence of this section does not imply that anything works or is even tested */
67 : #define CYTHON_COMPILING_IN_PYPY 0
68 : #define CYTHON_COMPILING_IN_CPYTHON 0
69 : #define CYTHON_COMPILING_IN_LIMITED_API 0
70 : #define CYTHON_COMPILING_IN_GRAAL 1
71 : #define CYTHON_COMPILING_IN_NOGIL 0
72 : #undef CYTHON_USE_TYPE_SLOTS
73 : #define CYTHON_USE_TYPE_SLOTS 0
74 : #undef CYTHON_USE_TYPE_SPECS
75 : #define CYTHON_USE_TYPE_SPECS 0
76 : #undef CYTHON_USE_PYTYPE_LOOKUP
77 : #define CYTHON_USE_PYTYPE_LOOKUP 0
78 : #if PY_VERSION_HEX < 0x03050000
79 : #undef CYTHON_USE_ASYNC_SLOTS
80 : #define CYTHON_USE_ASYNC_SLOTS 0
81 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
82 : #define CYTHON_USE_ASYNC_SLOTS 1
83 : #endif
84 : #undef CYTHON_USE_PYLIST_INTERNALS
85 : #define CYTHON_USE_PYLIST_INTERNALS 0
86 : #undef CYTHON_USE_UNICODE_INTERNALS
87 : #define CYTHON_USE_UNICODE_INTERNALS 0
88 : #undef CYTHON_USE_UNICODE_WRITER
89 : #define CYTHON_USE_UNICODE_WRITER 0
90 : #undef CYTHON_USE_PYLONG_INTERNALS
91 : #define CYTHON_USE_PYLONG_INTERNALS 0
92 : #undef CYTHON_AVOID_BORROWED_REFS
93 : #define CYTHON_AVOID_BORROWED_REFS 1
94 : #undef CYTHON_ASSUME_SAFE_MACROS
95 : #define CYTHON_ASSUME_SAFE_MACROS 0
96 : #undef CYTHON_UNPACK_METHODS
97 : #define CYTHON_UNPACK_METHODS 0
98 : #undef CYTHON_FAST_THREAD_STATE
99 : #define CYTHON_FAST_THREAD_STATE 0
100 : #undef CYTHON_FAST_GIL
101 : #define CYTHON_FAST_GIL 0
102 : #undef CYTHON_METH_FASTCALL
103 : #define CYTHON_METH_FASTCALL 0
104 : #undef CYTHON_FAST_PYCALL
105 : #define CYTHON_FAST_PYCALL 0
106 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
107 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
108 : #endif
109 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
110 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
111 : #undef CYTHON_USE_MODULE_STATE
112 : #define CYTHON_USE_MODULE_STATE 0
113 : #undef CYTHON_USE_TP_FINALIZE
114 : #define CYTHON_USE_TP_FINALIZE 0
115 : #undef CYTHON_USE_DICT_VERSIONS
116 : #define CYTHON_USE_DICT_VERSIONS 0
117 : #undef CYTHON_USE_EXC_INFO_STACK
118 : #define CYTHON_USE_EXC_INFO_STACK 0
119 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
120 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
121 : #endif
122 : #undef CYTHON_USE_FREELISTS
123 : #define CYTHON_USE_FREELISTS 0
124 : #elif defined(PYPY_VERSION)
125 : #define CYTHON_COMPILING_IN_PYPY 1
126 : #define CYTHON_COMPILING_IN_CPYTHON 0
127 : #define CYTHON_COMPILING_IN_LIMITED_API 0
128 : #define CYTHON_COMPILING_IN_GRAAL 0
129 : #define CYTHON_COMPILING_IN_NOGIL 0
130 : #undef CYTHON_USE_TYPE_SLOTS
131 : #define CYTHON_USE_TYPE_SLOTS 0
132 : #ifndef CYTHON_USE_TYPE_SPECS
133 : #define CYTHON_USE_TYPE_SPECS 0
134 : #endif
135 : #undef CYTHON_USE_PYTYPE_LOOKUP
136 : #define CYTHON_USE_PYTYPE_LOOKUP 0
137 : #if PY_VERSION_HEX < 0x03050000
138 : #undef CYTHON_USE_ASYNC_SLOTS
139 : #define CYTHON_USE_ASYNC_SLOTS 0
140 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
141 : #define CYTHON_USE_ASYNC_SLOTS 1
142 : #endif
143 : #undef CYTHON_USE_PYLIST_INTERNALS
144 : #define CYTHON_USE_PYLIST_INTERNALS 0
145 : #undef CYTHON_USE_UNICODE_INTERNALS
146 : #define CYTHON_USE_UNICODE_INTERNALS 0
147 : #undef CYTHON_USE_UNICODE_WRITER
148 : #define CYTHON_USE_UNICODE_WRITER 0
149 : #undef CYTHON_USE_PYLONG_INTERNALS
150 : #define CYTHON_USE_PYLONG_INTERNALS 0
151 : #undef CYTHON_AVOID_BORROWED_REFS
152 : #define CYTHON_AVOID_BORROWED_REFS 1
153 : #undef CYTHON_ASSUME_SAFE_MACROS
154 : #define CYTHON_ASSUME_SAFE_MACROS 0
155 : #undef CYTHON_UNPACK_METHODS
156 : #define CYTHON_UNPACK_METHODS 0
157 : #undef CYTHON_FAST_THREAD_STATE
158 : #define CYTHON_FAST_THREAD_STATE 0
159 : #undef CYTHON_FAST_GIL
160 : #define CYTHON_FAST_GIL 0
161 : #undef CYTHON_METH_FASTCALL
162 : #define CYTHON_METH_FASTCALL 0
163 : #undef CYTHON_FAST_PYCALL
164 : #define CYTHON_FAST_PYCALL 0
165 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 : #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
167 : #endif
168 : #if PY_VERSION_HEX < 0x03090000
169 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
170 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
171 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
172 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
173 : #endif
174 : #undef CYTHON_USE_MODULE_STATE
175 : #define CYTHON_USE_MODULE_STATE 0
176 : #undef CYTHON_USE_TP_FINALIZE
177 : #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
178 : #undef CYTHON_USE_DICT_VERSIONS
179 : #define CYTHON_USE_DICT_VERSIONS 0
180 : #undef CYTHON_USE_EXC_INFO_STACK
181 : #define CYTHON_USE_EXC_INFO_STACK 0
182 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
183 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
184 : #endif
185 : #undef CYTHON_USE_FREELISTS
186 : #define CYTHON_USE_FREELISTS 0
187 : #elif defined(CYTHON_LIMITED_API)
188 : #ifdef Py_LIMITED_API
189 : #undef __PYX_LIMITED_VERSION_HEX
190 : #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
191 : #endif
192 : #define CYTHON_COMPILING_IN_PYPY 0
193 : #define CYTHON_COMPILING_IN_CPYTHON 0
194 : #define CYTHON_COMPILING_IN_LIMITED_API 1
195 : #define CYTHON_COMPILING_IN_GRAAL 0
196 : #define CYTHON_COMPILING_IN_NOGIL 0
197 : #undef CYTHON_CLINE_IN_TRACEBACK
198 : #define CYTHON_CLINE_IN_TRACEBACK 0
199 : #undef CYTHON_USE_TYPE_SLOTS
200 : #define CYTHON_USE_TYPE_SLOTS 0
201 : #undef CYTHON_USE_TYPE_SPECS
202 : #define CYTHON_USE_TYPE_SPECS 1
203 : #undef CYTHON_USE_PYTYPE_LOOKUP
204 : #define CYTHON_USE_PYTYPE_LOOKUP 0
205 : #undef CYTHON_USE_ASYNC_SLOTS
206 : #define CYTHON_USE_ASYNC_SLOTS 0
207 : #undef CYTHON_USE_PYLIST_INTERNALS
208 : #define CYTHON_USE_PYLIST_INTERNALS 0
209 : #undef CYTHON_USE_UNICODE_INTERNALS
210 : #define CYTHON_USE_UNICODE_INTERNALS 0
211 : #ifndef CYTHON_USE_UNICODE_WRITER
212 : #define CYTHON_USE_UNICODE_WRITER 0
213 : #endif
214 : #undef CYTHON_USE_PYLONG_INTERNALS
215 : #define CYTHON_USE_PYLONG_INTERNALS 0
216 : #ifndef CYTHON_AVOID_BORROWED_REFS
217 : #define CYTHON_AVOID_BORROWED_REFS 0
218 : #endif
219 : #undef CYTHON_ASSUME_SAFE_MACROS
220 : #define CYTHON_ASSUME_SAFE_MACROS 0
221 : #undef CYTHON_UNPACK_METHODS
222 : #define CYTHON_UNPACK_METHODS 0
223 : #undef CYTHON_FAST_THREAD_STATE
224 : #define CYTHON_FAST_THREAD_STATE 0
225 : #undef CYTHON_FAST_GIL
226 : #define CYTHON_FAST_GIL 0
227 : #undef CYTHON_METH_FASTCALL
228 : #define CYTHON_METH_FASTCALL 0
229 : #undef CYTHON_FAST_PYCALL
230 : #define CYTHON_FAST_PYCALL 0
231 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
232 : #define CYTHON_PEP487_INIT_SUBCLASS 1
233 : #endif
234 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
235 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
236 : #undef CYTHON_USE_MODULE_STATE
237 : #define CYTHON_USE_MODULE_STATE 1
238 : #ifndef CYTHON_USE_TP_FINALIZE
239 : #define CYTHON_USE_TP_FINALIZE 0
240 : #endif
241 : #undef CYTHON_USE_DICT_VERSIONS
242 : #define CYTHON_USE_DICT_VERSIONS 0
243 : #undef CYTHON_USE_EXC_INFO_STACK
244 : #define CYTHON_USE_EXC_INFO_STACK 0
245 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
246 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
247 : #endif
248 : #undef CYTHON_USE_FREELISTS
249 : #define CYTHON_USE_FREELISTS 0
250 : #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
251 : #define CYTHON_COMPILING_IN_PYPY 0
252 : #define CYTHON_COMPILING_IN_CPYTHON 0
253 : #define CYTHON_COMPILING_IN_LIMITED_API 0
254 : #define CYTHON_COMPILING_IN_GRAAL 0
255 : #define CYTHON_COMPILING_IN_NOGIL 1
256 : #ifndef CYTHON_USE_TYPE_SLOTS
257 : #define CYTHON_USE_TYPE_SLOTS 1
258 : #endif
259 : #ifndef CYTHON_USE_TYPE_SPECS
260 : #define CYTHON_USE_TYPE_SPECS 0
261 : #endif
262 : #undef CYTHON_USE_PYTYPE_LOOKUP
263 : #define CYTHON_USE_PYTYPE_LOOKUP 0
264 : #ifndef CYTHON_USE_ASYNC_SLOTS
265 : #define CYTHON_USE_ASYNC_SLOTS 1
266 : #endif
267 : #ifndef CYTHON_USE_PYLONG_INTERNALS
268 : #define CYTHON_USE_PYLONG_INTERNALS 0
269 : #endif
270 : #undef CYTHON_USE_PYLIST_INTERNALS
271 : #define CYTHON_USE_PYLIST_INTERNALS 0
272 : #ifndef CYTHON_USE_UNICODE_INTERNALS
273 : #define CYTHON_USE_UNICODE_INTERNALS 1
274 : #endif
275 : #undef CYTHON_USE_UNICODE_WRITER
276 : #define CYTHON_USE_UNICODE_WRITER 0
277 : #ifndef CYTHON_AVOID_BORROWED_REFS
278 : #define CYTHON_AVOID_BORROWED_REFS 0
279 : #endif
280 : #ifndef CYTHON_ASSUME_SAFE_MACROS
281 : #define CYTHON_ASSUME_SAFE_MACROS 1
282 : #endif
283 : #ifndef CYTHON_UNPACK_METHODS
284 : #define CYTHON_UNPACK_METHODS 1
285 : #endif
286 : #undef CYTHON_FAST_THREAD_STATE
287 : #define CYTHON_FAST_THREAD_STATE 0
288 : #undef CYTHON_FAST_GIL
289 : #define CYTHON_FAST_GIL 0
290 : #ifndef CYTHON_METH_FASTCALL
291 : #define CYTHON_METH_FASTCALL 1
292 : #endif
293 : #undef CYTHON_FAST_PYCALL
294 : #define CYTHON_FAST_PYCALL 0
295 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
296 : #define CYTHON_PEP487_INIT_SUBCLASS 1
297 : #endif
298 : #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
299 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
300 : #endif
301 : #ifndef CYTHON_USE_MODULE_STATE
302 : #define CYTHON_USE_MODULE_STATE 0
303 : #endif
304 : #ifndef CYTHON_USE_TP_FINALIZE
305 : #define CYTHON_USE_TP_FINALIZE 1
306 : #endif
307 : #undef CYTHON_USE_DICT_VERSIONS
308 : #define CYTHON_USE_DICT_VERSIONS 0
309 : #undef CYTHON_USE_EXC_INFO_STACK
310 : #define CYTHON_USE_EXC_INFO_STACK 0
311 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
312 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
313 : #endif
314 : #ifndef CYTHON_USE_FREELISTS
315 : #define CYTHON_USE_FREELISTS 0
316 : #endif
317 : #else
318 : #define CYTHON_COMPILING_IN_PYPY 0
319 : #define CYTHON_COMPILING_IN_CPYTHON 1
320 : #define CYTHON_COMPILING_IN_LIMITED_API 0
321 : #define CYTHON_COMPILING_IN_GRAAL 0
322 : #define CYTHON_COMPILING_IN_NOGIL 0
323 : #ifndef CYTHON_USE_TYPE_SLOTS
324 : #define CYTHON_USE_TYPE_SLOTS 1
325 : #endif
326 : #ifndef CYTHON_USE_TYPE_SPECS
327 : #define CYTHON_USE_TYPE_SPECS 0
328 : #endif
329 : #ifndef CYTHON_USE_PYTYPE_LOOKUP
330 : #define CYTHON_USE_PYTYPE_LOOKUP 1
331 : #endif
332 : #if PY_MAJOR_VERSION < 3
333 : #undef CYTHON_USE_ASYNC_SLOTS
334 : #define CYTHON_USE_ASYNC_SLOTS 0
335 : #elif !defined(CYTHON_USE_ASYNC_SLOTS)
336 : #define CYTHON_USE_ASYNC_SLOTS 1
337 : #endif
338 : #ifndef CYTHON_USE_PYLONG_INTERNALS
339 : #define CYTHON_USE_PYLONG_INTERNALS 1
340 : #endif
341 : #ifndef CYTHON_USE_PYLIST_INTERNALS
342 : #define CYTHON_USE_PYLIST_INTERNALS 1
343 : #endif
344 : #ifndef CYTHON_USE_UNICODE_INTERNALS
345 : #define CYTHON_USE_UNICODE_INTERNALS 1
346 : #endif
347 : #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
348 : #undef CYTHON_USE_UNICODE_WRITER
349 : #define CYTHON_USE_UNICODE_WRITER 0
350 : #elif !defined(CYTHON_USE_UNICODE_WRITER)
351 : #define CYTHON_USE_UNICODE_WRITER 1
352 : #endif
353 : #ifndef CYTHON_AVOID_BORROWED_REFS
354 : #define CYTHON_AVOID_BORROWED_REFS 0
355 : #endif
356 : #ifndef CYTHON_ASSUME_SAFE_MACROS
357 : #define CYTHON_ASSUME_SAFE_MACROS 1
358 : #endif
359 : #ifndef CYTHON_UNPACK_METHODS
360 : #define CYTHON_UNPACK_METHODS 1
361 : #endif
362 : #ifndef CYTHON_FAST_THREAD_STATE
363 : #define CYTHON_FAST_THREAD_STATE 1
364 : #endif
365 : #ifndef CYTHON_FAST_GIL
366 : #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
367 : #endif
368 : #ifndef CYTHON_METH_FASTCALL
369 : #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
370 : #endif
371 : #ifndef CYTHON_FAST_PYCALL
372 : #define CYTHON_FAST_PYCALL 1
373 : #endif
374 : #ifndef CYTHON_PEP487_INIT_SUBCLASS
375 : #define CYTHON_PEP487_INIT_SUBCLASS 1
376 : #endif
377 : #if PY_VERSION_HEX < 0x03050000
378 : #undef CYTHON_PEP489_MULTI_PHASE_INIT
379 : #define CYTHON_PEP489_MULTI_PHASE_INIT 0
380 : #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
381 : #define CYTHON_PEP489_MULTI_PHASE_INIT 1
382 : #endif
383 : #ifndef CYTHON_USE_MODULE_STATE
384 : #define CYTHON_USE_MODULE_STATE 0
385 : #endif
386 : #if PY_VERSION_HEX < 0x030400a1
387 : #undef CYTHON_USE_TP_FINALIZE
388 : #define CYTHON_USE_TP_FINALIZE 0
389 : #elif !defined(CYTHON_USE_TP_FINALIZE)
390 : #define CYTHON_USE_TP_FINALIZE 1
391 : #endif
392 : #if PY_VERSION_HEX < 0x030600B1
393 : #undef CYTHON_USE_DICT_VERSIONS
394 : #define CYTHON_USE_DICT_VERSIONS 0
395 : #elif !defined(CYTHON_USE_DICT_VERSIONS)
396 : #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
397 : #endif
398 : #if PY_VERSION_HEX < 0x030700A3
399 : #undef CYTHON_USE_EXC_INFO_STACK
400 : #define CYTHON_USE_EXC_INFO_STACK 0
401 : #elif !defined(CYTHON_USE_EXC_INFO_STACK)
402 : #define CYTHON_USE_EXC_INFO_STACK 1
403 : #endif
404 : #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
405 : #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
406 : #endif
407 : #ifndef CYTHON_USE_FREELISTS
408 : #define CYTHON_USE_FREELISTS 1
409 : #endif
410 : #endif
411 : #if !defined(CYTHON_FAST_PYCCALL)
412 : #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
413 : #endif
414 : #if !defined(CYTHON_VECTORCALL)
415 : #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
416 : #endif
417 : #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
418 : #if CYTHON_USE_PYLONG_INTERNALS
419 : #if PY_MAJOR_VERSION < 3
420 : #include "longintrepr.h"
421 : #endif
422 : #undef SHIFT
423 : #undef BASE
424 : #undef MASK
425 : #ifdef SIZEOF_VOID_P
426 : enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
427 : #endif
428 : #endif
429 : #ifndef __has_attribute
430 : #define __has_attribute(x) 0
431 : #endif
432 : #ifndef __has_cpp_attribute
433 : #define __has_cpp_attribute(x) 0
434 : #endif
435 : #ifndef CYTHON_RESTRICT
436 : #if defined(__GNUC__)
437 : #define CYTHON_RESTRICT __restrict__
438 : #elif defined(_MSC_VER) && _MSC_VER >= 1400
439 : #define CYTHON_RESTRICT __restrict
440 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
441 : #define CYTHON_RESTRICT restrict
442 : #else
443 : #define CYTHON_RESTRICT
444 : #endif
445 : #endif
446 : #ifndef CYTHON_UNUSED
447 : #if defined(__cplusplus)
448 : /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
449 : * but leads to warnings with -pedantic, since it is a C++17 feature */
450 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
451 : #if __has_cpp_attribute(maybe_unused)
452 : #define CYTHON_UNUSED [[maybe_unused]]
453 : #endif
454 : #endif
455 : #endif
456 : #endif
457 : #ifndef CYTHON_UNUSED
458 : # if defined(__GNUC__)
459 : # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
460 : # define CYTHON_UNUSED __attribute__ ((__unused__))
461 : # else
462 : # define CYTHON_UNUSED
463 : # endif
464 : # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
465 : # define CYTHON_UNUSED __attribute__ ((__unused__))
466 : # else
467 : # define CYTHON_UNUSED
468 : # endif
469 : #endif
470 : #ifndef CYTHON_UNUSED_VAR
471 : # if defined(__cplusplus)
472 : template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
473 : # else
474 : # define CYTHON_UNUSED_VAR(x) (void)(x)
475 : # endif
476 : #endif
477 : #ifndef CYTHON_MAYBE_UNUSED_VAR
478 : #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
479 : #endif
480 : #ifndef CYTHON_NCP_UNUSED
481 : # if CYTHON_COMPILING_IN_CPYTHON
482 : # define CYTHON_NCP_UNUSED
483 : # else
484 : # define CYTHON_NCP_UNUSED CYTHON_UNUSED
485 : # endif
486 : #endif
487 : #ifndef CYTHON_USE_CPP_STD_MOVE
488 : #if defined(__cplusplus) && (\
489 : __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
490 : #define CYTHON_USE_CPP_STD_MOVE 1
491 : #else
492 : #define CYTHON_USE_CPP_STD_MOVE 0
493 : #endif
494 : #endif
495 : #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
496 : #ifdef _MSC_VER
497 : #ifndef _MSC_STDINT_H_
498 : #if _MSC_VER < 1300
499 : typedef unsigned char uint8_t;
500 : typedef unsigned short uint16_t;
501 : typedef unsigned int uint32_t;
502 : #else
503 : typedef unsigned __int8 uint8_t;
504 : typedef unsigned __int16 uint16_t;
505 : typedef unsigned __int32 uint32_t;
506 : #endif
507 : #endif
508 : #if _MSC_VER < 1300
509 : #ifdef _WIN64
510 : typedef unsigned long long __pyx_uintptr_t;
511 : #else
512 : typedef unsigned int __pyx_uintptr_t;
513 : #endif
514 : #else
515 : #ifdef _WIN64
516 : typedef unsigned __int64 __pyx_uintptr_t;
517 : #else
518 : typedef unsigned __int32 __pyx_uintptr_t;
519 : #endif
520 : #endif
521 : #else
522 : #include <stdint.h>
523 : typedef uintptr_t __pyx_uintptr_t;
524 : #endif
525 : #ifndef CYTHON_FALLTHROUGH
526 : #if defined(__cplusplus)
527 : /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
528 : * but leads to warnings with -pedantic, since it is a C++17 feature */
529 : #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
530 : #if __has_cpp_attribute(fallthrough)
531 : #define CYTHON_FALLTHROUGH [[fallthrough]]
532 : #endif
533 : #endif
534 : #ifndef CYTHON_FALLTHROUGH
535 : #if __has_cpp_attribute(clang::fallthrough)
536 : #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
537 : #elif __has_cpp_attribute(gnu::fallthrough)
538 : #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
539 : #endif
540 : #endif
541 : #endif
542 : #ifndef CYTHON_FALLTHROUGH
543 : #if __has_attribute(fallthrough)
544 : #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
545 : #else
546 : #define CYTHON_FALLTHROUGH
547 : #endif
548 : #endif
549 : #if defined(__clang__) && defined(__apple_build_version__)
550 : #if __apple_build_version__ < 7000000
551 : #undef CYTHON_FALLTHROUGH
552 : #define CYTHON_FALLTHROUGH
553 : #endif
554 : #endif
555 : #endif
556 : #ifdef __cplusplus
557 : template <typename T>
558 : struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
559 : #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
560 : #else
561 : #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
562 : #endif
563 : #if CYTHON_COMPILING_IN_PYPY == 1
564 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
565 : #else
566 : #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
567 : #endif
568 : #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
569 :
570 : #ifndef CYTHON_INLINE
571 : #if defined(__clang__)
572 : #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
573 : #elif defined(__GNUC__)
574 : #define CYTHON_INLINE __inline__
575 : #elif defined(_MSC_VER)
576 : #define CYTHON_INLINE __inline
577 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
578 : #define CYTHON_INLINE inline
579 : #else
580 : #define CYTHON_INLINE
581 : #endif
582 : #endif
583 :
584 : #define __PYX_BUILD_PY_SSIZE_T "n"
585 : #define CYTHON_FORMAT_SSIZE_T "z"
586 : #if PY_MAJOR_VERSION < 3
587 : #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
588 : #define __Pyx_DefaultClassType PyClass_Type
589 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
590 : PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
591 : #else
592 : #define __Pyx_BUILTIN_MODULE_NAME "builtins"
593 : #define __Pyx_DefaultClassType PyType_Type
594 : #if CYTHON_COMPILING_IN_LIMITED_API
595 : static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
596 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
597 : PyObject *fv, PyObject *cell, PyObject* fn,
598 : PyObject *name, int fline, PyObject *lnos) {
599 : PyObject *exception_table = NULL;
600 : PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
601 : #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
602 : PyObject *version_info;
603 : PyObject *py_minor_version = NULL;
604 : #endif
605 : long minor_version = 0;
606 : PyObject *type, *value, *traceback;
607 : PyErr_Fetch(&type, &value, &traceback);
608 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
609 : minor_version = 11;
610 : #else
611 : if (!(version_info = PySys_GetObject("version_info"))) goto end;
612 : if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
613 : minor_version = PyLong_AsLong(py_minor_version);
614 : Py_DECREF(py_minor_version);
615 : if (minor_version == -1 && PyErr_Occurred()) goto end;
616 : #endif
617 : if (!(types_module = PyImport_ImportModule("types"))) goto end;
618 : if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
619 : if (minor_version <= 7) {
620 : (void)p;
621 : result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
622 : c, n, v, fn, name, fline, lnos, fv, cell);
623 : } else if (minor_version <= 10) {
624 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
625 : c, n, v, fn, name, fline, lnos, fv, cell);
626 : } else {
627 : if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
628 : result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
629 : c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
630 : }
631 : end:
632 : Py_XDECREF(code_type);
633 : Py_XDECREF(exception_table);
634 : Py_XDECREF(types_module);
635 : if (type) {
636 : PyErr_Restore(type, value, traceback);
637 : }
638 : return result;
639 : }
640 : #ifndef CO_OPTIMIZED
641 : #define CO_OPTIMIZED 0x0001
642 : #endif
643 : #ifndef CO_NEWLOCALS
644 : #define CO_NEWLOCALS 0x0002
645 : #endif
646 : #ifndef CO_VARARGS
647 : #define CO_VARARGS 0x0004
648 : #endif
649 : #ifndef CO_VARKEYWORDS
650 : #define CO_VARKEYWORDS 0x0008
651 : #endif
652 : #ifndef CO_ASYNC_GENERATOR
653 : #define CO_ASYNC_GENERATOR 0x0200
654 : #endif
655 : #ifndef CO_GENERATOR
656 : #define CO_GENERATOR 0x0020
657 : #endif
658 : #ifndef CO_COROUTINE
659 : #define CO_COROUTINE 0x0080
660 : #endif
661 : #elif PY_VERSION_HEX >= 0x030B0000
662 15 : static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
663 : PyObject *code, PyObject *c, PyObject* n, PyObject *v,
664 : PyObject *fv, PyObject *cell, PyObject* fn,
665 : PyObject *name, int fline, PyObject *lnos) {
666 15 : PyCodeObject *result;
667 15 : PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
668 15 : if (!empty_bytes) return NULL;
669 15 : result =
670 : #if PY_VERSION_HEX >= 0x030C0000
671 15 : PyUnstable_Code_NewWithPosOnlyArgs
672 : #else
673 : PyCode_NewWithPosOnlyArgs
674 : #endif
675 : (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
676 15 : Py_DECREF(empty_bytes);
677 : return result;
678 : }
679 : #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
680 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
681 : PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
682 : #else
683 : #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
684 : PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
685 : #endif
686 : #endif
687 : #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
688 : #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
689 : #else
690 : #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
691 : #endif
692 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
693 : #define __Pyx_Py_Is(x, y) Py_Is(x, y)
694 : #else
695 : #define __Pyx_Py_Is(x, y) ((x) == (y))
696 : #endif
697 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
698 : #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
699 : #else
700 : #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
701 : #endif
702 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
703 : #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
704 : #else
705 : #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
706 : #endif
707 : #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
708 : #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
709 : #else
710 : #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
711 : #endif
712 : #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
713 : #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
714 : #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
715 : #else
716 : #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
717 : #endif
718 : #ifndef CO_COROUTINE
719 : #define CO_COROUTINE 0x80
720 : #endif
721 : #ifndef CO_ASYNC_GENERATOR
722 : #define CO_ASYNC_GENERATOR 0x200
723 : #endif
724 : #ifndef Py_TPFLAGS_CHECKTYPES
725 : #define Py_TPFLAGS_CHECKTYPES 0
726 : #endif
727 : #ifndef Py_TPFLAGS_HAVE_INDEX
728 : #define Py_TPFLAGS_HAVE_INDEX 0
729 : #endif
730 : #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
731 : #define Py_TPFLAGS_HAVE_NEWBUFFER 0
732 : #endif
733 : #ifndef Py_TPFLAGS_HAVE_FINALIZE
734 : #define Py_TPFLAGS_HAVE_FINALIZE 0
735 : #endif
736 : #ifndef Py_TPFLAGS_SEQUENCE
737 : #define Py_TPFLAGS_SEQUENCE 0
738 : #endif
739 : #ifndef Py_TPFLAGS_MAPPING
740 : #define Py_TPFLAGS_MAPPING 0
741 : #endif
742 : #ifndef METH_STACKLESS
743 : #define METH_STACKLESS 0
744 : #endif
745 : #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
746 : #ifndef METH_FASTCALL
747 : #define METH_FASTCALL 0x80
748 : #endif
749 : typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
750 : typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
751 : Py_ssize_t nargs, PyObject *kwnames);
752 : #else
753 : #if PY_VERSION_HEX >= 0x030d00A4
754 : # define __Pyx_PyCFunctionFast PyCFunctionFast
755 : # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
756 : #else
757 : # define __Pyx_PyCFunctionFast _PyCFunctionFast
758 : # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
759 : #endif
760 : #endif
761 : #if CYTHON_METH_FASTCALL
762 : #define __Pyx_METH_FASTCALL METH_FASTCALL
763 : #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
764 : #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
765 : #else
766 : #define __Pyx_METH_FASTCALL METH_VARARGS
767 : #define __Pyx_PyCFunction_FastCall PyCFunction
768 : #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
769 : #endif
770 : #if CYTHON_VECTORCALL
771 : #define __pyx_vectorcallfunc vectorcallfunc
772 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
773 : #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
774 : #elif CYTHON_BACKPORT_VECTORCALL
775 : typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
776 : size_t nargsf, PyObject *kwnames);
777 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
778 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
779 : #else
780 : #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
781 : #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
782 : #endif
783 : #if PY_MAJOR_VERSION >= 0x030900B1
784 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
785 : #else
786 : #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
787 : #endif
788 : #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
789 : #if CYTHON_COMPILING_IN_CPYTHON
790 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
791 : #elif !CYTHON_COMPILING_IN_LIMITED_API
792 : #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
793 : #endif
794 : #if CYTHON_COMPILING_IN_CPYTHON
795 : #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
796 0 : static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
797 0 : return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
798 : }
799 : #endif
800 : static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
801 : #if CYTHON_COMPILING_IN_LIMITED_API
802 : return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
803 : #else
804 : return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
805 : #endif
806 : }
807 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
808 : #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
809 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
810 : typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
811 : #else
812 : #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
813 : #define __Pyx_PyCMethod PyCMethod
814 : #endif
815 : #ifndef METH_METHOD
816 : #define METH_METHOD 0x200
817 : #endif
818 : #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
819 : #define PyObject_Malloc(s) PyMem_Malloc(s)
820 : #define PyObject_Free(p) PyMem_Free(p)
821 : #define PyObject_Realloc(p) PyMem_Realloc(p)
822 : #endif
823 : #if CYTHON_COMPILING_IN_LIMITED_API
824 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
825 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
826 : #else
827 : #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
828 : #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
829 : #endif
830 : #if CYTHON_COMPILING_IN_LIMITED_API
831 : #define __Pyx_PyThreadState_Current PyThreadState_Get()
832 : #elif !CYTHON_FAST_THREAD_STATE
833 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
834 : #elif PY_VERSION_HEX >= 0x030d00A1
835 : #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
836 : #elif PY_VERSION_HEX >= 0x03060000
837 : #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
838 : #elif PY_VERSION_HEX >= 0x03000000
839 : #define __Pyx_PyThreadState_Current PyThreadState_GET()
840 : #else
841 : #define __Pyx_PyThreadState_Current _PyThreadState_Current
842 : #endif
843 : #if CYTHON_COMPILING_IN_LIMITED_API
844 : static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
845 : {
846 : void *result;
847 : result = PyModule_GetState(op);
848 : if (!result)
849 : Py_FatalError("Couldn't find the module state");
850 : return result;
851 : }
852 : #endif
853 : #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
854 : #if CYTHON_COMPILING_IN_LIMITED_API
855 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
856 : #else
857 : #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
858 : #endif
859 : #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
860 : #include "pythread.h"
861 : #define Py_tss_NEEDS_INIT 0
862 : typedef int Py_tss_t;
863 : static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
864 : *key = PyThread_create_key();
865 : return 0;
866 : }
867 : static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
868 : Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
869 : *key = Py_tss_NEEDS_INIT;
870 : return key;
871 : }
872 : static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
873 : PyObject_Free(key);
874 : }
875 : static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
876 : return *key != Py_tss_NEEDS_INIT;
877 : }
878 : static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
879 : PyThread_delete_key(*key);
880 : *key = Py_tss_NEEDS_INIT;
881 : }
882 : static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
883 : return PyThread_set_key_value(*key, value);
884 : }
885 : static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
886 : return PyThread_get_key_value(*key);
887 : }
888 : #endif
889 : #if PY_MAJOR_VERSION < 3
890 : #if CYTHON_COMPILING_IN_PYPY
891 : #if PYPY_VERSION_NUM < 0x07030600
892 : #if defined(__cplusplus) && __cplusplus >= 201402L
893 : [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
894 : #elif defined(__GNUC__) || defined(__clang__)
895 : __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
896 : #elif defined(_MSC_VER)
897 : __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
898 : #endif
899 : static CYTHON_INLINE int PyGILState_Check(void) {
900 : return 0;
901 : }
902 : #else // PYPY_VERSION_NUM < 0x07030600
903 : #endif // PYPY_VERSION_NUM < 0x07030600
904 : #else
905 : static CYTHON_INLINE int PyGILState_Check(void) {
906 : PyThreadState * tstate = _PyThreadState_Current;
907 : return tstate && (tstate == PyGILState_GetThisThreadState());
908 : }
909 : #endif
910 : #endif
911 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
912 : #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
913 : #else
914 : #define __Pyx_PyDict_NewPresized(n) PyDict_New()
915 : #endif
916 : #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
917 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
918 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
919 : #else
920 : #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
921 : #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
922 : #endif
923 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
924 : #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
925 20 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
926 20 : PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
927 20 : if (res == NULL) PyErr_Clear();
928 20 : return res;
929 : }
930 : #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
931 : #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
932 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
933 : #else
934 : static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
935 : #if CYTHON_COMPILING_IN_PYPY
936 : return PyDict_GetItem(dict, name);
937 : #else
938 : PyDictEntry *ep;
939 : PyDictObject *mp = (PyDictObject*) dict;
940 : long hash = ((PyStringObject *) name)->ob_shash;
941 : assert(hash != -1);
942 : ep = (mp->ma_lookup)(mp, name, hash);
943 : if (ep == NULL) {
944 : return NULL;
945 : }
946 : return ep->me_value;
947 : #endif
948 : }
949 : #define __Pyx_PyDict_GetItemStr PyDict_GetItem
950 : #endif
951 : #if CYTHON_USE_TYPE_SLOTS
952 : #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
953 : #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
954 : #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
955 : #else
956 : #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
957 : #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
958 : #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
959 : #endif
960 : #if CYTHON_COMPILING_IN_LIMITED_API
961 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
962 : #else
963 : #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
964 : #endif
965 : #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
966 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
967 : PyTypeObject *type = Py_TYPE((PyObject*)obj);\
968 : assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
969 : PyObject_GC_Del(obj);\
970 : Py_DECREF(type);\
971 : }
972 : #else
973 : #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
974 : #endif
975 : #if CYTHON_COMPILING_IN_LIMITED_API
976 : #define CYTHON_PEP393_ENABLED 1
977 : #define __Pyx_PyUnicode_READY(op) (0)
978 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
979 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
980 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
981 : #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
982 : #define __Pyx_PyUnicode_DATA(u) ((void*)u)
983 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
984 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
985 : #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
986 : #define CYTHON_PEP393_ENABLED 1
987 : #if PY_VERSION_HEX >= 0x030C0000
988 : #define __Pyx_PyUnicode_READY(op) (0)
989 : #else
990 : #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
991 : 0 : _PyUnicode_Ready((PyObject *)(op)))
992 : #endif
993 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
994 : #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
995 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
996 : #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
997 : #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
998 : #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
999 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
1000 : #if PY_VERSION_HEX >= 0x030C0000
1001 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
1002 : #else
1003 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
1004 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
1005 : #else
1006 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
1007 : #endif
1008 : #endif
1009 : #else
1010 : #define CYTHON_PEP393_ENABLED 0
1011 : #define PyUnicode_1BYTE_KIND 1
1012 : #define PyUnicode_2BYTE_KIND 2
1013 : #define PyUnicode_4BYTE_KIND 4
1014 : #define __Pyx_PyUnicode_READY(op) (0)
1015 : #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
1016 : #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
1017 : #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
1018 : #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
1019 : #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
1020 : #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
1021 : #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
1022 : #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
1023 : #endif
1024 : #if CYTHON_COMPILING_IN_PYPY
1025 : #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
1026 : #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
1027 : #else
1028 : #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
1029 : #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
1030 : PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
1031 : #endif
1032 : #if CYTHON_COMPILING_IN_PYPY
1033 : #if !defined(PyUnicode_DecodeUnicodeEscape)
1034 : #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
1035 : #endif
1036 : #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
1037 : #undef PyUnicode_Contains
1038 : #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
1039 : #endif
1040 : #if !defined(PyByteArray_Check)
1041 : #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
1042 : #endif
1043 : #if !defined(PyObject_Format)
1044 : #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
1045 : #endif
1046 : #endif
1047 : #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
1048 : #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
1049 : #if PY_MAJOR_VERSION >= 3
1050 : #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
1051 : #else
1052 : #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
1053 : #endif
1054 : #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
1055 : #define PyObject_ASCII(o) PyObject_Repr(o)
1056 : #endif
1057 : #if PY_MAJOR_VERSION >= 3
1058 : #define PyBaseString_Type PyUnicode_Type
1059 : #define PyStringObject PyUnicodeObject
1060 : #define PyString_Type PyUnicode_Type
1061 : #define PyString_Check PyUnicode_Check
1062 : #define PyString_CheckExact PyUnicode_CheckExact
1063 : #ifndef PyObject_Unicode
1064 : #define PyObject_Unicode PyObject_Str
1065 : #endif
1066 : #endif
1067 : #if PY_MAJOR_VERSION >= 3
1068 : #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
1069 : #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
1070 : #else
1071 : #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
1072 : #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
1073 : #endif
1074 : #if CYTHON_COMPILING_IN_CPYTHON
1075 : #define __Pyx_PySequence_ListKeepNew(obj)\
1076 : (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
1077 : #else
1078 : #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
1079 : #endif
1080 : #ifndef PySet_CheckExact
1081 : #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
1082 : #endif
1083 : #if PY_VERSION_HEX >= 0x030900A4
1084 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
1085 : #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
1086 : #else
1087 : #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
1088 : #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
1089 : #endif
1090 : #if CYTHON_ASSUME_SAFE_MACROS
1091 : #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
1092 : #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
1093 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
1094 : #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
1095 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
1096 : #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
1097 : #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
1098 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
1099 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
1100 : #else
1101 : #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
1102 : #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
1103 : #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
1104 : #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
1105 : #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
1106 : #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
1107 : #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
1108 : #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1109 : #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1110 : #endif
1111 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1112 : #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1113 : #else
1114 9 : static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1115 9 : PyObject *module = PyImport_AddModule(name);
1116 9 : Py_XINCREF(module);
1117 9 : return module;
1118 : }
1119 : #endif
1120 : #if PY_MAJOR_VERSION >= 3
1121 : #define PyIntObject PyLongObject
1122 : #define PyInt_Type PyLong_Type
1123 : #define PyInt_Check(op) PyLong_Check(op)
1124 : #define PyInt_CheckExact(op) PyLong_CheckExact(op)
1125 : #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
1126 : #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
1127 : #define PyInt_FromString PyLong_FromString
1128 : #define PyInt_FromUnicode PyLong_FromUnicode
1129 : #define PyInt_FromLong PyLong_FromLong
1130 : #define PyInt_FromSize_t PyLong_FromSize_t
1131 : #define PyInt_FromSsize_t PyLong_FromSsize_t
1132 : #define PyInt_AsLong PyLong_AsLong
1133 : #define PyInt_AS_LONG PyLong_AS_LONG
1134 : #define PyInt_AsSsize_t PyLong_AsSsize_t
1135 : #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
1136 : #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
1137 : #define PyNumber_Int PyNumber_Long
1138 : #else
1139 : #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
1140 : #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
1141 : #endif
1142 : #if PY_MAJOR_VERSION >= 3
1143 : #define PyBoolObject PyLongObject
1144 : #endif
1145 : #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
1146 : #ifndef PyUnicode_InternFromString
1147 : #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
1148 : #endif
1149 : #endif
1150 : #if PY_VERSION_HEX < 0x030200A4
1151 : typedef long Py_hash_t;
1152 : #define __Pyx_PyInt_FromHash_t PyInt_FromLong
1153 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
1154 : #else
1155 : #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
1156 : #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
1157 : #endif
1158 : #if CYTHON_USE_ASYNC_SLOTS
1159 : #if PY_VERSION_HEX >= 0x030500B1
1160 : #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
1161 : #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
1162 : #else
1163 : #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
1164 : #endif
1165 : #else
1166 : #define __Pyx_PyType_AsAsync(obj) NULL
1167 : #endif
1168 : #ifndef __Pyx_PyAsyncMethodsStruct
1169 : typedef struct {
1170 : unaryfunc am_await;
1171 : unaryfunc am_aiter;
1172 : unaryfunc am_anext;
1173 : } __Pyx_PyAsyncMethodsStruct;
1174 : #endif
1175 :
1176 : #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
1177 : #if !defined(_USE_MATH_DEFINES)
1178 : #define _USE_MATH_DEFINES
1179 : #endif
1180 : #endif
1181 : #include <math.h>
1182 : #ifdef NAN
1183 : #define __PYX_NAN() ((float) NAN)
1184 : #else
1185 : static CYTHON_INLINE float __PYX_NAN() {
1186 : float value;
1187 : memset(&value, 0xFF, sizeof(value));
1188 : return value;
1189 : }
1190 : #endif
1191 : #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
1192 : #define __Pyx_truncl trunc
1193 : #else
1194 : #define __Pyx_truncl truncl
1195 : #endif
1196 :
1197 : #define __PYX_MARK_ERR_POS(f_index, lineno) \
1198 : { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1199 : #define __PYX_ERR(f_index, lineno, Ln_error) \
1200 : { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1201 :
1202 : #ifdef CYTHON_EXTERN_C
1203 : #undef __PYX_EXTERN_C
1204 : #define __PYX_EXTERN_C CYTHON_EXTERN_C
1205 : #elif defined(__PYX_EXTERN_C)
1206 : #ifdef _MSC_VER
1207 : #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
1208 : #else
1209 : #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
1210 : #endif
1211 : #else
1212 : #ifdef __cplusplus
1213 : #define __PYX_EXTERN_C extern "C"
1214 : #else
1215 : #define __PYX_EXTERN_C extern
1216 : #endif
1217 : #endif
1218 :
1219 : #define __PYX_HAVE__scipy__signal___peak_finding_utils
1220 : #define __PYX_HAVE_API__scipy__signal___peak_finding_utils
1221 : /* Early includes */
1222 : #include <string.h>
1223 : #include <stdio.h>
1224 :
1225 : /* Using NumPy API declarations from "numpy/__init__.cython-30.pxd" */
1226 :
1227 : #include "numpy/arrayobject.h"
1228 : #include "numpy/ndarrayobject.h"
1229 : #include "numpy/ndarraytypes.h"
1230 : #include "numpy/arrayscalars.h"
1231 : #include "numpy/ufuncobject.h"
1232 : #include <math.h>
1233 : #include "pythread.h"
1234 : #include <stdlib.h>
1235 : #ifdef _OPENMP
1236 : #include <omp.h>
1237 : #endif /* _OPENMP */
1238 :
1239 : #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
1240 : #define CYTHON_WITHOUT_ASSERTIONS
1241 : #endif
1242 :
1243 : typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
1244 : const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
1245 :
1246 : #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
1247 : #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
1248 : #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
1249 : #define __PYX_DEFAULT_STRING_ENCODING ""
1250 : #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
1251 : #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1252 : #define __Pyx_uchar_cast(c) ((unsigned char)c)
1253 : #define __Pyx_long_cast(x) ((long)x)
1254 : #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
1255 : (sizeof(type) < sizeof(Py_ssize_t)) ||\
1256 : (sizeof(type) > sizeof(Py_ssize_t) &&\
1257 : likely(v < (type)PY_SSIZE_T_MAX ||\
1258 : v == (type)PY_SSIZE_T_MAX) &&\
1259 : (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
1260 : v == (type)PY_SSIZE_T_MIN))) ||\
1261 : (sizeof(type) == sizeof(Py_ssize_t) &&\
1262 : (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
1263 : v == (type)PY_SSIZE_T_MAX))) )
1264 0 : static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
1265 0 : return (size_t) i < (size_t) limit;
1266 : }
1267 : #if defined (__cplusplus) && __cplusplus >= 201103L
1268 : #include <cstdlib>
1269 : #define __Pyx_sst_abs(value) std::abs(value)
1270 : #elif SIZEOF_INT >= SIZEOF_SIZE_T
1271 : #define __Pyx_sst_abs(value) abs(value)
1272 : #elif SIZEOF_LONG >= SIZEOF_SIZE_T
1273 : #define __Pyx_sst_abs(value) labs(value)
1274 : #elif defined (_MSC_VER)
1275 : #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
1276 : #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
1277 : #define __Pyx_sst_abs(value) llabs(value)
1278 : #elif defined (__GNUC__)
1279 : #define __Pyx_sst_abs(value) __builtin_llabs(value)
1280 : #else
1281 : #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
1282 : #endif
1283 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
1284 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
1285 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
1286 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
1287 : #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
1288 : #define __Pyx_PyBytes_FromString PyBytes_FromString
1289 : #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
1290 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1291 : #if PY_MAJOR_VERSION < 3
1292 : #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
1293 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
1294 : #else
1295 : #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
1296 : #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
1297 : #endif
1298 : #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
1299 : #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
1300 : #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
1301 : #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
1302 : #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
1303 : #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
1304 : #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1305 : #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1306 : #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
1307 : #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
1308 : #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
1309 : #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
1310 : #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
1311 : #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1312 : #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1313 : #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1314 : #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1315 : #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1316 : #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1317 : #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
1318 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
1319 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
1320 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
1321 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
1322 : #define __Pyx_PySequence_Tuple(obj)\
1323 : (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
1324 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
1325 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
1326 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1327 : #if CYTHON_ASSUME_SAFE_MACROS
1328 : #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
1329 : #else
1330 : #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
1331 : #endif
1332 : #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
1333 : #if PY_MAJOR_VERSION >= 3
1334 : #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
1335 : #else
1336 : #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
1337 : #endif
1338 : #if CYTHON_USE_PYLONG_INTERNALS
1339 : #if PY_VERSION_HEX >= 0x030C00A7
1340 : #ifndef _PyLong_SIGN_MASK
1341 : #define _PyLong_SIGN_MASK 3
1342 : #endif
1343 : #ifndef _PyLong_NON_SIZE_BITS
1344 : #define _PyLong_NON_SIZE_BITS 3
1345 : #endif
1346 : #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
1347 : #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
1348 : #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
1349 : #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
1350 : #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
1351 : #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
1352 : #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
1353 : #define __Pyx_PyLong_SignedDigitCount(x)\
1354 : ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
1355 : #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
1356 : #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
1357 : #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
1358 : #else
1359 : #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
1360 : #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
1361 : #endif
1362 : typedef Py_ssize_t __Pyx_compact_pylong;
1363 : typedef size_t __Pyx_compact_upylong;
1364 : #else
1365 : #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1366 : #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1367 : #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
1368 : #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
1369 : #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
1370 : #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
1371 : #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
1372 : #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
1373 : #define __Pyx_PyLong_CompactValue(x)\
1374 : ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
1375 : typedef sdigit __Pyx_compact_pylong;
1376 : typedef digit __Pyx_compact_upylong;
1377 : #endif
1378 : #if PY_VERSION_HEX >= 0x030C00A5
1379 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
1380 : #else
1381 : #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
1382 : #endif
1383 : #endif
1384 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
1385 : #include <string.h>
1386 : static int __Pyx_sys_getdefaultencoding_not_ascii;
1387 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1388 : PyObject* sys;
1389 : PyObject* default_encoding = NULL;
1390 : PyObject* ascii_chars_u = NULL;
1391 : PyObject* ascii_chars_b = NULL;
1392 : const char* default_encoding_c;
1393 : sys = PyImport_ImportModule("sys");
1394 : if (!sys) goto bad;
1395 : default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
1396 : Py_DECREF(sys);
1397 : if (!default_encoding) goto bad;
1398 : default_encoding_c = PyBytes_AsString(default_encoding);
1399 : if (!default_encoding_c) goto bad;
1400 : if (strcmp(default_encoding_c, "ascii") == 0) {
1401 : __Pyx_sys_getdefaultencoding_not_ascii = 0;
1402 : } else {
1403 : char ascii_chars[128];
1404 : int c;
1405 : for (c = 0; c < 128; c++) {
1406 : ascii_chars[c] = (char) c;
1407 : }
1408 : __Pyx_sys_getdefaultencoding_not_ascii = 1;
1409 : ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
1410 : if (!ascii_chars_u) goto bad;
1411 : ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
1412 : if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
1413 : PyErr_Format(
1414 : PyExc_ValueError,
1415 : "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
1416 : default_encoding_c);
1417 : goto bad;
1418 : }
1419 : Py_DECREF(ascii_chars_u);
1420 : Py_DECREF(ascii_chars_b);
1421 : }
1422 : Py_DECREF(default_encoding);
1423 : return 0;
1424 : bad:
1425 : Py_XDECREF(default_encoding);
1426 : Py_XDECREF(ascii_chars_u);
1427 : Py_XDECREF(ascii_chars_b);
1428 : return -1;
1429 : }
1430 : #endif
1431 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
1432 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
1433 : #else
1434 : #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
1435 : #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
1436 : #include <string.h>
1437 : static char* __PYX_DEFAULT_STRING_ENCODING;
1438 : static int __Pyx_init_sys_getdefaultencoding_params(void) {
1439 : PyObject* sys;
1440 : PyObject* default_encoding = NULL;
1441 : char* default_encoding_c;
1442 : sys = PyImport_ImportModule("sys");
1443 : if (!sys) goto bad;
1444 : default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
1445 : Py_DECREF(sys);
1446 : if (!default_encoding) goto bad;
1447 : default_encoding_c = PyBytes_AsString(default_encoding);
1448 : if (!default_encoding_c) goto bad;
1449 : __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1450 : if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1451 : strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1452 : Py_DECREF(default_encoding);
1453 : return 0;
1454 : bad:
1455 : Py_XDECREF(default_encoding);
1456 : return -1;
1457 : }
1458 : #endif
1459 : #endif
1460 :
1461 :
1462 : /* Test for GCC > 2.95 */
1463 : #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1464 : #define likely(x) __builtin_expect(!!(x), 1)
1465 : #define unlikely(x) __builtin_expect(!!(x), 0)
1466 : #else /* !__GNUC__ or GCC < 2.95 */
1467 : #define likely(x) (x)
1468 : #define unlikely(x) (x)
1469 : #endif /* __GNUC__ */
1470 : static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1471 :
1472 : #if !CYTHON_USE_MODULE_STATE
1473 : static PyObject *__pyx_m = NULL;
1474 : #endif
1475 : static int __pyx_lineno;
1476 : static int __pyx_clineno = 0;
1477 : static const char * __pyx_cfilenm = __FILE__;
1478 : static const char *__pyx_filename;
1479 :
1480 : /* Header.proto */
1481 : #if !defined(CYTHON_CCOMPLEX)
1482 : #if defined(__cplusplus)
1483 : #define CYTHON_CCOMPLEX 1
1484 : #elif (defined(_Complex_I) && !defined(_MSC_VER)) || ((defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_COMPLEX__) && !defined(_MSC_VER))
1485 : #define CYTHON_CCOMPLEX 1
1486 : #else
1487 : #define CYTHON_CCOMPLEX 0
1488 : #endif
1489 : #endif
1490 : #if CYTHON_CCOMPLEX
1491 : #ifdef __cplusplus
1492 : #include <complex>
1493 : #else
1494 : #include <complex.h>
1495 : #endif
1496 : #endif
1497 : #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
1498 : #undef _Complex_I
1499 : #define _Complex_I 1.0fj
1500 : #endif
1501 :
1502 : /* #### Code section: filename_table ### */
1503 :
1504 : static const char *__pyx_f[] = {
1505 : "_peak_finding_utils.pyx",
1506 : "<stringsource>",
1507 : "__init__.cython-30.pxd",
1508 : "type.pxd",
1509 : };
1510 : /* #### Code section: utility_code_proto_before_types ### */
1511 : /* ForceInitThreads.proto */
1512 : #ifndef __PYX_FORCE_INIT_THREADS
1513 : #define __PYX_FORCE_INIT_THREADS 0
1514 : #endif
1515 :
1516 : /* NoFastGil.proto */
1517 : #define __Pyx_PyGILState_Ensure PyGILState_Ensure
1518 : #define __Pyx_PyGILState_Release PyGILState_Release
1519 : #define __Pyx_FastGIL_Remember()
1520 : #define __Pyx_FastGIL_Forget()
1521 : #define __Pyx_FastGilFuncInit()
1522 :
1523 : /* BufferFormatStructs.proto */
1524 : struct __Pyx_StructField_;
1525 : #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
1526 : typedef struct {
1527 : const char* name;
1528 : struct __Pyx_StructField_* fields;
1529 : size_t size;
1530 : size_t arraysize[8];
1531 : int ndim;
1532 : char typegroup;
1533 : char is_unsigned;
1534 : int flags;
1535 : } __Pyx_TypeInfo;
1536 : typedef struct __Pyx_StructField_ {
1537 : __Pyx_TypeInfo* type;
1538 : const char* name;
1539 : size_t offset;
1540 : } __Pyx_StructField;
1541 : typedef struct {
1542 : __Pyx_StructField* field;
1543 : size_t parent_offset;
1544 : } __Pyx_BufFmt_StackElem;
1545 : typedef struct {
1546 : __Pyx_StructField root;
1547 : __Pyx_BufFmt_StackElem* head;
1548 : size_t fmt_offset;
1549 : size_t new_count, enc_count;
1550 : size_t struct_alignment;
1551 : int is_complex;
1552 : char enc_type;
1553 : char new_packmode;
1554 : char enc_packmode;
1555 : char is_valid_array;
1556 : } __Pyx_BufFmt_Context;
1557 :
1558 : /* Atomics.proto */
1559 : #include <pythread.h>
1560 : #ifndef CYTHON_ATOMICS
1561 : #define CYTHON_ATOMICS 1
1562 : #endif
1563 : #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
1564 : #define __pyx_atomic_int_type int
1565 : #define __pyx_nonatomic_int_type int
1566 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1567 : (__STDC_VERSION__ >= 201112L) &&\
1568 : !defined(__STDC_NO_ATOMICS__))
1569 : #include <stdatomic.h>
1570 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1571 : (__cplusplus >= 201103L) ||\
1572 : (defined(_MSC_VER) && _MSC_VER >= 1700)))
1573 : #include <atomic>
1574 : #endif
1575 : #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
1576 : (__STDC_VERSION__ >= 201112L) &&\
1577 : !defined(__STDC_NO_ATOMICS__) &&\
1578 : ATOMIC_INT_LOCK_FREE == 2)
1579 : #undef __pyx_atomic_int_type
1580 : #define __pyx_atomic_int_type atomic_int
1581 : #define __pyx_atomic_incr_aligned(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
1582 : #define __pyx_atomic_decr_aligned(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
1583 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1584 : #pragma message ("Using standard C atomics")
1585 : #elif defined(__PYX_DEBUG_ATOMICS)
1586 : #warning "Using standard C atomics"
1587 : #endif
1588 : #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
1589 : (__cplusplus >= 201103L) ||\
1590 : \
1591 : (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
1592 : ATOMIC_INT_LOCK_FREE == 2)
1593 : #undef __pyx_atomic_int_type
1594 : #define __pyx_atomic_int_type std::atomic_int
1595 : #define __pyx_atomic_incr_aligned(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
1596 : #define __pyx_atomic_decr_aligned(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
1597 : #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
1598 : #pragma message ("Using standard C++ atomics")
1599 : #elif defined(__PYX_DEBUG_ATOMICS)
1600 : #warning "Using standard C++ atomics"
1601 : #endif
1602 : #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
1603 : (__GNUC_MINOR__ > 1 ||\
1604 : (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
1605 : #define __pyx_atomic_incr_aligned(value) __sync_fetch_and_add(value, 1)
1606 : #define __pyx_atomic_decr_aligned(value) __sync_fetch_and_sub(value, 1)
1607 : #ifdef __PYX_DEBUG_ATOMICS
1608 : #warning "Using GNU atomics"
1609 : #endif
1610 : #elif CYTHON_ATOMICS && defined(_MSC_VER)
1611 : #include <intrin.h>
1612 : #undef __pyx_atomic_int_type
1613 : #define __pyx_atomic_int_type long
1614 : #undef __pyx_nonatomic_int_type
1615 : #define __pyx_nonatomic_int_type long
1616 : #pragma intrinsic (_InterlockedExchangeAdd)
1617 : #define __pyx_atomic_incr_aligned(value) _InterlockedExchangeAdd(value, 1)
1618 : #define __pyx_atomic_decr_aligned(value) _InterlockedExchangeAdd(value, -1)
1619 : #ifdef __PYX_DEBUG_ATOMICS
1620 : #pragma message ("Using MSVC atomics")
1621 : #endif
1622 : #else
1623 : #undef CYTHON_ATOMICS
1624 : #define CYTHON_ATOMICS 0
1625 : #ifdef __PYX_DEBUG_ATOMICS
1626 : #warning "Not using atomics"
1627 : #endif
1628 : #endif
1629 : #if CYTHON_ATOMICS
1630 : #define __pyx_add_acquisition_count(memview)\
1631 : __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview))
1632 : #define __pyx_sub_acquisition_count(memview)\
1633 : __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview))
1634 : #else
1635 : #define __pyx_add_acquisition_count(memview)\
1636 : __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1637 : #define __pyx_sub_acquisition_count(memview)\
1638 : __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
1639 : #endif
1640 :
1641 : /* MemviewSliceStruct.proto */
1642 : struct __pyx_memoryview_obj;
1643 : typedef struct {
1644 : struct __pyx_memoryview_obj *memview;
1645 : char *data;
1646 : Py_ssize_t shape[8];
1647 : Py_ssize_t strides[8];
1648 : Py_ssize_t suboffsets[8];
1649 : } __Pyx_memviewslice;
1650 : #define __Pyx_MemoryView_Len(m) (m.shape[0])
1651 :
1652 : /* #### Code section: numeric_typedefs ### */
1653 :
1654 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":769
1655 : * # in Cython to enable them only on the right systems.
1656 : *
1657 : * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
1658 : * ctypedef npy_int16 int16_t
1659 : * ctypedef npy_int32 int32_t
1660 : */
1661 : typedef npy_int8 __pyx_t_5numpy_int8_t;
1662 :
1663 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":770
1664 : *
1665 : * ctypedef npy_int8 int8_t
1666 : * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
1667 : * ctypedef npy_int32 int32_t
1668 : * ctypedef npy_int64 int64_t
1669 : */
1670 : typedef npy_int16 __pyx_t_5numpy_int16_t;
1671 :
1672 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":771
1673 : * ctypedef npy_int8 int8_t
1674 : * ctypedef npy_int16 int16_t
1675 : * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
1676 : * ctypedef npy_int64 int64_t
1677 : * #ctypedef npy_int96 int96_t
1678 : */
1679 : typedef npy_int32 __pyx_t_5numpy_int32_t;
1680 :
1681 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":772
1682 : * ctypedef npy_int16 int16_t
1683 : * ctypedef npy_int32 int32_t
1684 : * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
1685 : * #ctypedef npy_int96 int96_t
1686 : * #ctypedef npy_int128 int128_t
1687 : */
1688 : typedef npy_int64 __pyx_t_5numpy_int64_t;
1689 :
1690 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":776
1691 : * #ctypedef npy_int128 int128_t
1692 : *
1693 : * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
1694 : * ctypedef npy_uint16 uint16_t
1695 : * ctypedef npy_uint32 uint32_t
1696 : */
1697 : typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1698 :
1699 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":777
1700 : *
1701 : * ctypedef npy_uint8 uint8_t
1702 : * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
1703 : * ctypedef npy_uint32 uint32_t
1704 : * ctypedef npy_uint64 uint64_t
1705 : */
1706 : typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1707 :
1708 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":778
1709 : * ctypedef npy_uint8 uint8_t
1710 : * ctypedef npy_uint16 uint16_t
1711 : * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
1712 : * ctypedef npy_uint64 uint64_t
1713 : * #ctypedef npy_uint96 uint96_t
1714 : */
1715 : typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1716 :
1717 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":779
1718 : * ctypedef npy_uint16 uint16_t
1719 : * ctypedef npy_uint32 uint32_t
1720 : * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
1721 : * #ctypedef npy_uint96 uint96_t
1722 : * #ctypedef npy_uint128 uint128_t
1723 : */
1724 : typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1725 :
1726 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":783
1727 : * #ctypedef npy_uint128 uint128_t
1728 : *
1729 : * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
1730 : * ctypedef npy_float64 float64_t
1731 : * #ctypedef npy_float80 float80_t
1732 : */
1733 : typedef npy_float32 __pyx_t_5numpy_float32_t;
1734 :
1735 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":784
1736 : *
1737 : * ctypedef npy_float32 float32_t
1738 : * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
1739 : * #ctypedef npy_float80 float80_t
1740 : * #ctypedef npy_float128 float128_t
1741 : */
1742 : typedef npy_float64 __pyx_t_5numpy_float64_t;
1743 :
1744 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":791
1745 : * ctypedef double complex complex128_t
1746 : *
1747 : * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1748 : * ctypedef npy_ulonglong ulonglong_t
1749 : *
1750 : */
1751 : typedef npy_longlong __pyx_t_5numpy_longlong_t;
1752 :
1753 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":792
1754 : *
1755 : * ctypedef npy_longlong longlong_t
1756 : * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1757 : *
1758 : * ctypedef npy_intp intp_t
1759 : */
1760 : typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1761 :
1762 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":794
1763 : * ctypedef npy_ulonglong ulonglong_t
1764 : *
1765 : * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1766 : * ctypedef npy_uintp uintp_t
1767 : *
1768 : */
1769 : typedef npy_intp __pyx_t_5numpy_intp_t;
1770 :
1771 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":795
1772 : *
1773 : * ctypedef npy_intp intp_t
1774 : * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1775 : *
1776 : * ctypedef npy_double float_t
1777 : */
1778 : typedef npy_uintp __pyx_t_5numpy_uintp_t;
1779 :
1780 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":797
1781 : * ctypedef npy_uintp uintp_t
1782 : *
1783 : * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1784 : * ctypedef npy_double double_t
1785 : * ctypedef npy_longdouble longdouble_t
1786 : */
1787 : typedef npy_double __pyx_t_5numpy_float_t;
1788 :
1789 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":798
1790 : *
1791 : * ctypedef npy_double float_t
1792 : * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1793 : * ctypedef npy_longdouble longdouble_t
1794 : *
1795 : */
1796 : typedef npy_double __pyx_t_5numpy_double_t;
1797 :
1798 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":799
1799 : * ctypedef npy_double float_t
1800 : * ctypedef npy_double double_t
1801 : * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1802 : *
1803 : * ctypedef float complex cfloat_t
1804 : */
1805 : typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1806 : /* #### Code section: complex_type_declarations ### */
1807 : /* Declarations.proto */
1808 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1809 : #ifdef __cplusplus
1810 : typedef ::std::complex< float > __pyx_t_float_complex;
1811 : #else
1812 : typedef float _Complex __pyx_t_float_complex;
1813 : #endif
1814 : #else
1815 : typedef struct { float real, imag; } __pyx_t_float_complex;
1816 : #endif
1817 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1818 :
1819 : /* Declarations.proto */
1820 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1821 : #ifdef __cplusplus
1822 : typedef ::std::complex< double > __pyx_t_double_complex;
1823 : #else
1824 : typedef double _Complex __pyx_t_double_complex;
1825 : #endif
1826 : #else
1827 : typedef struct { double real, imag; } __pyx_t_double_complex;
1828 : #endif
1829 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1830 :
1831 : /* Declarations.proto */
1832 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
1833 : #ifdef __cplusplus
1834 : typedef ::std::complex< long double > __pyx_t_long_double_complex;
1835 : #else
1836 : typedef long double _Complex __pyx_t_long_double_complex;
1837 : #endif
1838 : #else
1839 : typedef struct { long double real, imag; } __pyx_t_long_double_complex;
1840 : #endif
1841 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double, long double);
1842 :
1843 : /* #### Code section: type_declarations ### */
1844 :
1845 : /*--- Type declarations ---*/
1846 : struct __pyx_array_obj;
1847 : struct __pyx_MemviewEnum_obj;
1848 : struct __pyx_memoryview_obj;
1849 : struct __pyx_memoryviewslice_obj;
1850 :
1851 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1095
1852 : *
1853 : * # Iterator API added in v1.6
1854 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil # <<<<<<<<<<<<<<
1855 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil
1856 : *
1857 : */
1858 : typedef int (*__pyx_t_5numpy_NpyIter_IterNextFunc)(NpyIter *);
1859 :
1860 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1096
1861 : * # Iterator API added in v1.6
1862 : * ctypedef int (*NpyIter_IterNextFunc)(NpyIter* it) noexcept nogil
1863 : * ctypedef void (*NpyIter_GetMultiIndexFunc)(NpyIter* it, npy_intp* outcoords) noexcept nogil # <<<<<<<<<<<<<<
1864 : *
1865 : * cdef extern from "numpy/arrayobject.h":
1866 : */
1867 : typedef void (*__pyx_t_5numpy_NpyIter_GetMultiIndexFunc)(NpyIter *, npy_intp *);
1868 :
1869 : /* "View.MemoryView":114
1870 : * @cython.collection_type("sequence")
1871 : * @cname("__pyx_array")
1872 : * cdef class array: # <<<<<<<<<<<<<<
1873 : *
1874 : * cdef:
1875 : */
1876 : struct __pyx_array_obj {
1877 : PyObject_HEAD
1878 : struct __pyx_vtabstruct_array *__pyx_vtab;
1879 : char *data;
1880 : Py_ssize_t len;
1881 : char *format;
1882 : int ndim;
1883 : Py_ssize_t *_shape;
1884 : Py_ssize_t *_strides;
1885 : Py_ssize_t itemsize;
1886 : PyObject *mode;
1887 : PyObject *_format;
1888 : void (*callback_free_data)(void *);
1889 : int free_data;
1890 : int dtype_is_object;
1891 : };
1892 :
1893 :
1894 : /* "View.MemoryView":302
1895 : *
1896 : * @cname('__pyx_MemviewEnum')
1897 : * cdef class Enum(object): # <<<<<<<<<<<<<<
1898 : * cdef object name
1899 : * def __init__(self, name):
1900 : */
1901 : struct __pyx_MemviewEnum_obj {
1902 : PyObject_HEAD
1903 : PyObject *name;
1904 : };
1905 :
1906 :
1907 : /* "View.MemoryView":337
1908 : *
1909 : * @cname('__pyx_memoryview')
1910 : * cdef class memoryview: # <<<<<<<<<<<<<<
1911 : *
1912 : * cdef object obj
1913 : */
1914 : struct __pyx_memoryview_obj {
1915 : PyObject_HEAD
1916 : struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1917 : PyObject *obj;
1918 : PyObject *_size;
1919 : PyObject *_array_interface;
1920 : PyThread_type_lock lock;
1921 : __pyx_atomic_int_type acquisition_count;
1922 : Py_buffer view;
1923 : int flags;
1924 : int dtype_is_object;
1925 : __Pyx_TypeInfo *typeinfo;
1926 : };
1927 :
1928 :
1929 : /* "View.MemoryView":952
1930 : * @cython.collection_type("sequence")
1931 : * @cname('__pyx_memoryviewslice')
1932 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1933 : * "Internal class for passing memoryview slices to Python"
1934 : *
1935 : */
1936 : struct __pyx_memoryviewslice_obj {
1937 : struct __pyx_memoryview_obj __pyx_base;
1938 : __Pyx_memviewslice from_slice;
1939 : PyObject *from_object;
1940 : PyObject *(*to_object_func)(char *);
1941 : int (*to_dtype_func)(char *, PyObject *);
1942 : };
1943 :
1944 :
1945 :
1946 : /* "View.MemoryView":114
1947 : * @cython.collection_type("sequence")
1948 : * @cname("__pyx_array")
1949 : * cdef class array: # <<<<<<<<<<<<<<
1950 : *
1951 : * cdef:
1952 : */
1953 :
1954 : struct __pyx_vtabstruct_array {
1955 : PyObject *(*get_memview)(struct __pyx_array_obj *);
1956 : };
1957 : static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1958 :
1959 :
1960 : /* "View.MemoryView":337
1961 : *
1962 : * @cname('__pyx_memoryview')
1963 : * cdef class memoryview: # <<<<<<<<<<<<<<
1964 : *
1965 : * cdef object obj
1966 : */
1967 :
1968 : struct __pyx_vtabstruct_memoryview {
1969 : char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1970 : PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1971 : PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1972 : PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1973 : PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1974 : PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1975 : PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1976 : PyObject *(*_get_base)(struct __pyx_memoryview_obj *);
1977 : };
1978 : static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1979 :
1980 :
1981 : /* "View.MemoryView":952
1982 : * @cython.collection_type("sequence")
1983 : * @cname('__pyx_memoryviewslice')
1984 : * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1985 : * "Internal class for passing memoryview slices to Python"
1986 : *
1987 : */
1988 :
1989 : struct __pyx_vtabstruct__memoryviewslice {
1990 : struct __pyx_vtabstruct_memoryview __pyx_base;
1991 : };
1992 : static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1993 : /* #### Code section: utility_code_proto ### */
1994 :
1995 : /* --- Runtime support code (head) --- */
1996 : /* Refnanny.proto */
1997 : #ifndef CYTHON_REFNANNY
1998 : #define CYTHON_REFNANNY 0
1999 : #endif
2000 : #if CYTHON_REFNANNY
2001 : typedef struct {
2002 : void (*INCREF)(void*, PyObject*, Py_ssize_t);
2003 : void (*DECREF)(void*, PyObject*, Py_ssize_t);
2004 : void (*GOTREF)(void*, PyObject*, Py_ssize_t);
2005 : void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
2006 : void* (*SetupContext)(const char*, Py_ssize_t, const char*);
2007 : void (*FinishContext)(void**);
2008 : } __Pyx_RefNannyAPIStruct;
2009 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
2010 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
2011 : #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
2012 : #ifdef WITH_THREAD
2013 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2014 : if (acquire_gil) {\
2015 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2016 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2017 : PyGILState_Release(__pyx_gilstate_save);\
2018 : } else {\
2019 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
2020 : }
2021 : #define __Pyx_RefNannyFinishContextNogil() {\
2022 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2023 : __Pyx_RefNannyFinishContext();\
2024 : PyGILState_Release(__pyx_gilstate_save);\
2025 : }
2026 : #else
2027 : #define __Pyx_RefNannySetupContext(name, acquire_gil)\
2028 : __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
2029 : #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
2030 : #endif
2031 : #define __Pyx_RefNannyFinishContextNogil() {\
2032 : PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
2033 : __Pyx_RefNannyFinishContext();\
2034 : PyGILState_Release(__pyx_gilstate_save);\
2035 : }
2036 : #define __Pyx_RefNannyFinishContext()\
2037 : __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
2038 : #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2039 : #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2040 : #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2041 : #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
2042 : #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
2043 : #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
2044 : #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
2045 : #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
2046 : #else
2047 : #define __Pyx_RefNannyDeclarations
2048 : #define __Pyx_RefNannySetupContext(name, acquire_gil)
2049 : #define __Pyx_RefNannyFinishContextNogil()
2050 : #define __Pyx_RefNannyFinishContext()
2051 : #define __Pyx_INCREF(r) Py_INCREF(r)
2052 : #define __Pyx_DECREF(r) Py_DECREF(r)
2053 : #define __Pyx_GOTREF(r)
2054 : #define __Pyx_GIVEREF(r)
2055 : #define __Pyx_XINCREF(r) Py_XINCREF(r)
2056 : #define __Pyx_XDECREF(r) Py_XDECREF(r)
2057 : #define __Pyx_XGOTREF(r)
2058 : #define __Pyx_XGIVEREF(r)
2059 : #endif
2060 : #define __Pyx_Py_XDECREF_SET(r, v) do {\
2061 : PyObject *tmp = (PyObject *) r;\
2062 : r = v; Py_XDECREF(tmp);\
2063 : } while (0)
2064 : #define __Pyx_XDECREF_SET(r, v) do {\
2065 : PyObject *tmp = (PyObject *) r;\
2066 : r = v; __Pyx_XDECREF(tmp);\
2067 : } while (0)
2068 : #define __Pyx_DECREF_SET(r, v) do {\
2069 : PyObject *tmp = (PyObject *) r;\
2070 : r = v; __Pyx_DECREF(tmp);\
2071 : } while (0)
2072 : #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
2073 : #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
2074 :
2075 : /* PyErrExceptionMatches.proto */
2076 : #if CYTHON_FAST_THREAD_STATE
2077 : #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2078 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2079 : #else
2080 : #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2081 : #endif
2082 :
2083 : /* PyThreadStateGet.proto */
2084 : #if CYTHON_FAST_THREAD_STATE
2085 : #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2086 : #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
2087 : #if PY_VERSION_HEX >= 0x030C00A6
2088 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
2089 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
2090 : #else
2091 : #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
2092 : #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
2093 : #endif
2094 : #else
2095 : #define __Pyx_PyThreadState_declare
2096 : #define __Pyx_PyThreadState_assign
2097 : #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
2098 : #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
2099 : #endif
2100 :
2101 : /* PyErrFetchRestore.proto */
2102 : #if CYTHON_FAST_THREAD_STATE
2103 : #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
2104 : #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2105 : #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2106 : #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2107 : #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2108 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2109 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2110 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
2111 : #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
2112 : #else
2113 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2114 : #endif
2115 : #else
2116 : #define __Pyx_PyErr_Clear() PyErr_Clear()
2117 : #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
2118 : #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2119 : #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2120 : #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
2121 : #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
2122 : #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2123 : #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2124 : #endif
2125 :
2126 : /* PyObjectGetAttrStr.proto */
2127 : #if CYTHON_USE_TYPE_SLOTS
2128 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
2129 : #else
2130 : #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
2131 : #endif
2132 :
2133 : /* PyObjectGetAttrStrNoError.proto */
2134 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2135 :
2136 : /* GetBuiltinName.proto */
2137 : static PyObject *__Pyx_GetBuiltinName(PyObject *name);
2138 :
2139 : /* TupleAndListFromArray.proto */
2140 : #if CYTHON_COMPILING_IN_CPYTHON
2141 : static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
2142 : static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
2143 : #endif
2144 :
2145 : /* IncludeStringH.proto */
2146 : #include <string.h>
2147 :
2148 : /* BytesEquals.proto */
2149 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2150 :
2151 : /* UnicodeEquals.proto */
2152 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2153 :
2154 : /* fastcall.proto */
2155 : #if CYTHON_AVOID_BORROWED_REFS
2156 : #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
2157 : #elif CYTHON_ASSUME_SAFE_MACROS
2158 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
2159 : #else
2160 : #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
2161 : #endif
2162 : #if CYTHON_AVOID_BORROWED_REFS
2163 : #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
2164 : #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
2165 : #else
2166 : #define __Pyx_Arg_NewRef_VARARGS(arg) arg
2167 : #define __Pyx_Arg_XDECREF_VARARGS(arg)
2168 : #endif
2169 : #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
2170 : #define __Pyx_KwValues_VARARGS(args, nargs) NULL
2171 : #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
2172 : #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
2173 : #if CYTHON_METH_FASTCALL
2174 : #define __Pyx_Arg_FASTCALL(args, i) args[i]
2175 : #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
2176 : #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
2177 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
2178 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2179 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
2180 : #else
2181 : #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
2182 : #endif
2183 : #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
2184 : to have the same reference counting */
2185 : #define __Pyx_Arg_XDECREF_FASTCALL(arg)
2186 : #else
2187 : #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
2188 : #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
2189 : #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
2190 : #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
2191 : #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
2192 : #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
2193 : #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
2194 : #endif
2195 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2196 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
2197 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
2198 : #else
2199 : #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
2200 : #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
2201 : #endif
2202 :
2203 : /* RaiseArgTupleInvalid.proto */
2204 : static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
2205 : Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
2206 :
2207 : /* RaiseDoubleKeywords.proto */
2208 : static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
2209 :
2210 : /* ParseKeywords.proto */
2211 : static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
2212 : PyObject **argnames[],
2213 : PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
2214 : const char* function_name);
2215 :
2216 : /* ArgTypeTest.proto */
2217 : #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
2218 : ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
2219 : __Pyx__ArgTypeTest(obj, type, name, exact))
2220 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
2221 :
2222 : /* RaiseException.proto */
2223 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2224 :
2225 : /* PyFunctionFastCall.proto */
2226 : #if CYTHON_FAST_PYCALL
2227 : #if !CYTHON_VECTORCALL
2228 : #define __Pyx_PyFunction_FastCall(func, args, nargs)\
2229 : __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2230 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
2231 : #endif
2232 : #define __Pyx_BUILD_ASSERT_EXPR(cond)\
2233 : (sizeof(char [1 - 2*!(cond)]) - 1)
2234 : #ifndef Py_MEMBER_SIZE
2235 : #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
2236 : #endif
2237 : #if !CYTHON_VECTORCALL
2238 : #if PY_VERSION_HEX >= 0x03080000
2239 : #include "frameobject.h"
2240 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
2241 : #ifndef Py_BUILD_CORE
2242 : #define Py_BUILD_CORE 1
2243 : #endif
2244 : #include "internal/pycore_frame.h"
2245 : #endif
2246 : #define __Pxy_PyFrame_Initialize_Offsets()
2247 : #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
2248 : #else
2249 : static size_t __pyx_pyframe_localsplus_offset = 0;
2250 : #include "frameobject.h"
2251 : #define __Pxy_PyFrame_Initialize_Offsets()\
2252 : ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
2253 : (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
2254 : #define __Pyx_PyFrame_GetLocalsplus(frame)\
2255 : (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
2256 : #endif
2257 : #endif
2258 : #endif
2259 :
2260 : /* PyObjectCall.proto */
2261 : #if CYTHON_COMPILING_IN_CPYTHON
2262 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2263 : #else
2264 : #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2265 : #endif
2266 :
2267 : /* PyObjectCallMethO.proto */
2268 : #if CYTHON_COMPILING_IN_CPYTHON
2269 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2270 : #endif
2271 :
2272 : /* PyObjectFastCall.proto */
2273 : #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
2274 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
2275 :
2276 : /* RaiseUnexpectedTypeError.proto */
2277 : static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2278 :
2279 : /* GCCDiagnostics.proto */
2280 : #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2281 : #define __Pyx_HAS_GCC_DIAGNOSTIC
2282 : #endif
2283 :
2284 : /* BuildPyUnicode.proto */
2285 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
2286 : int prepend_sign, char padding_char);
2287 :
2288 : /* CIntToPyUnicode.proto */
2289 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char);
2290 :
2291 : /* CIntToPyUnicode.proto */
2292 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char);
2293 :
2294 : /* JoinPyUnicode.proto */
2295 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2296 : Py_UCS4 max_char);
2297 :
2298 : /* StrEquals.proto */
2299 : #if PY_MAJOR_VERSION >= 3
2300 : #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2301 : #else
2302 : #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2303 : #endif
2304 :
2305 : /* PyObjectFormatSimple.proto */
2306 : #if CYTHON_COMPILING_IN_PYPY
2307 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2308 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2309 : PyObject_Format(s, f))
2310 : #elif PY_MAJOR_VERSION < 3
2311 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2312 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2313 : likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
2314 : PyObject_Format(s, f))
2315 : #elif CYTHON_USE_TYPE_SLOTS
2316 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2317 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2318 : likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2319 : likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2320 : PyObject_Format(s, f))
2321 : #else
2322 : #define __Pyx_PyObject_FormatSimple(s, f) (\
2323 : likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2324 : PyObject_Format(s, f))
2325 : #endif
2326 :
2327 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2328 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
2329 : /* GetAttr.proto */
2330 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
2331 :
2332 : /* GetItemInt.proto */
2333 : #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2334 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2335 : __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2336 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2337 : __Pyx_GetItemInt_Generic(o, to_py_func(i))))
2338 : #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2339 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2340 : __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2341 : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2342 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2343 : int wraparound, int boundscheck);
2344 : #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2345 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2346 : __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2347 : (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2348 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2349 : int wraparound, int boundscheck);
2350 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2351 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2352 : int is_list, int wraparound, int boundscheck);
2353 :
2354 : /* PyObjectCallOneArg.proto */
2355 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2356 :
2357 : /* ObjectGetItem.proto */
2358 : #if CYTHON_USE_TYPE_SLOTS
2359 : static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
2360 : #else
2361 : #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
2362 : #endif
2363 :
2364 : /* KeywordStringCheck.proto */
2365 : static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
2366 :
2367 : /* DivInt[Py_ssize_t].proto */
2368 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
2369 :
2370 : /* UnaryNegOverflows.proto */
2371 : #define __Pyx_UNARY_NEG_WOULD_OVERFLOW(x)\
2372 : (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
2373 :
2374 : /* GetAttr3.proto */
2375 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
2376 :
2377 : /* PyDictVersioning.proto */
2378 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
2379 : #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
2380 : #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
2381 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
2382 : (version_var) = __PYX_GET_DICT_VERSION(dict);\
2383 : (cache_var) = (value);
2384 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
2385 : static PY_UINT64_T __pyx_dict_version = 0;\
2386 : static PyObject *__pyx_dict_cached_value = NULL;\
2387 : if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
2388 : (VAR) = __pyx_dict_cached_value;\
2389 : } else {\
2390 : (VAR) = __pyx_dict_cached_value = (LOOKUP);\
2391 : __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
2392 : }\
2393 : }
2394 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
2395 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
2396 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
2397 : #else
2398 : #define __PYX_GET_DICT_VERSION(dict) (0)
2399 : #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
2400 : #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
2401 : #endif
2402 :
2403 : /* GetModuleGlobalName.proto */
2404 : #if CYTHON_USE_DICT_VERSIONS
2405 : #define __Pyx_GetModuleGlobalName(var, name) do {\
2406 : static PY_UINT64_T __pyx_dict_version = 0;\
2407 : static PyObject *__pyx_dict_cached_value = NULL;\
2408 : (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
2409 : (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
2410 : __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2411 : } while(0)
2412 : #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
2413 : PY_UINT64_T __pyx_dict_version;\
2414 : PyObject *__pyx_dict_cached_value;\
2415 : (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
2416 : } while(0)
2417 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
2418 : #else
2419 : #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2420 : #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
2421 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
2422 : #endif
2423 :
2424 : /* AssertionsEnabled.proto */
2425 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
2426 : #define __Pyx_init_assertions_enabled() (0)
2427 : #define __pyx_assertions_enabled() (1)
2428 : #elif CYTHON_COMPILING_IN_LIMITED_API || (CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030C0000)
2429 : static int __pyx_assertions_enabled_flag;
2430 : #define __pyx_assertions_enabled() (__pyx_assertions_enabled_flag)
2431 3 : static int __Pyx_init_assertions_enabled(void) {
2432 3 : PyObject *builtins, *debug, *debug_str;
2433 3 : int flag;
2434 3 : builtins = PyEval_GetBuiltins();
2435 3 : if (!builtins) goto bad;
2436 3 : debug_str = PyUnicode_FromStringAndSize("__debug__", 9);
2437 3 : if (!debug_str) goto bad;
2438 3 : debug = PyObject_GetItem(builtins, debug_str);
2439 3 : Py_DECREF(debug_str);
2440 3 : if (!debug) goto bad;
2441 3 : flag = PyObject_IsTrue(debug);
2442 3 : Py_DECREF(debug);
2443 3 : if (flag == -1) goto bad;
2444 3 : __pyx_assertions_enabled_flag = flag;
2445 3 : return 0;
2446 0 : bad:
2447 0 : __pyx_assertions_enabled_flag = 1;
2448 0 : return -1;
2449 : }
2450 : #else
2451 : #define __Pyx_init_assertions_enabled() (0)
2452 : #define __pyx_assertions_enabled() (!Py_OptimizeFlag)
2453 : #endif
2454 :
2455 : /* RaiseTooManyValuesToUnpack.proto */
2456 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2457 :
2458 : /* RaiseNeedMoreValuesToUnpack.proto */
2459 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2460 :
2461 : /* RaiseNoneIterError.proto */
2462 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
2463 :
2464 : /* ExtTypeTest.proto */
2465 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2466 :
2467 : /* GetTopmostException.proto */
2468 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
2469 : static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
2470 : #endif
2471 :
2472 : /* SaveResetException.proto */
2473 : #if CYTHON_FAST_THREAD_STATE
2474 : #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2475 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2476 : #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2477 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2478 : #else
2479 : #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2480 : #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2481 : #endif
2482 :
2483 : /* GetException.proto */
2484 : #if CYTHON_FAST_THREAD_STATE
2485 : #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2486 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2487 : #else
2488 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2489 : #endif
2490 :
2491 : /* SwapException.proto */
2492 : #if CYTHON_FAST_THREAD_STATE
2493 : #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
2494 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2495 : #else
2496 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
2497 : #endif
2498 :
2499 : /* Import.proto */
2500 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2501 :
2502 : /* ImportDottedModule.proto */
2503 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
2504 : #if PY_MAJOR_VERSION >= 3
2505 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
2506 : #endif
2507 :
2508 : /* FastTypeChecks.proto */
2509 : #if CYTHON_COMPILING_IN_CPYTHON
2510 : #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2511 : #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
2512 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2513 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
2514 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2515 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2516 : #else
2517 : #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2518 : #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
2519 : #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2520 : #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2521 : #endif
2522 : #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
2523 : #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2524 :
2525 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
2526 : /* ListCompAppend.proto */
2527 : #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2528 0 : static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2529 0 : PyListObject* L = (PyListObject*) list;
2530 0 : Py_ssize_t len = Py_SIZE(list);
2531 0 : if (likely(L->allocated > len)) {
2532 0 : Py_INCREF(x);
2533 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
2534 : L->ob_item[len] = x;
2535 : #else
2536 0 : PyList_SET_ITEM(list, len, x);
2537 : #endif
2538 0 : __Pyx_SET_SIZE(list, len + 1);
2539 0 : return 0;
2540 : }
2541 0 : return PyList_Append(list, x);
2542 : }
2543 : #else
2544 : #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2545 : #endif
2546 :
2547 : /* PySequenceMultiply.proto */
2548 : #define __Pyx_PySequence_Multiply_Left(mul, seq) __Pyx_PySequence_Multiply(seq, mul)
2549 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul);
2550 :
2551 : /* SetItemInt.proto */
2552 : #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2553 : (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2554 : __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
2555 : (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
2556 : __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
2557 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
2558 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
2559 : int is_list, int wraparound, int boundscheck);
2560 :
2561 : /* RaiseUnboundLocalError.proto */
2562 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2563 :
2564 : /* DivInt[long].proto */
2565 : static CYTHON_INLINE long __Pyx_div_long(long, long);
2566 :
2567 : /* PySequenceContains.proto */
2568 0 : static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
2569 0 : int result = PySequence_Contains(seq, item);
2570 0 : return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
2571 : }
2572 :
2573 : /* ImportFrom.proto */
2574 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2575 :
2576 : /* HasAttr.proto */
2577 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2578 :
2579 : /* DivInt[__pyx_t_5numpy_intp_t].proto */
2580 : static CYTHON_INLINE __pyx_t_5numpy_intp_t __Pyx_div___pyx_t_5numpy_intp_t(__pyx_t_5numpy_intp_t, __pyx_t_5numpy_intp_t);
2581 :
2582 : /* PyObject_GenericGetAttrNoDict.proto */
2583 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2584 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2585 : #else
2586 : #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2587 : #endif
2588 :
2589 : /* PyObject_GenericGetAttr.proto */
2590 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2591 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2592 : #else
2593 : #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2594 : #endif
2595 :
2596 : /* IncludeStructmemberH.proto */
2597 : #include <structmember.h>
2598 :
2599 : /* FixUpExtensionType.proto */
2600 : #if CYTHON_USE_TYPE_SPECS
2601 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
2602 : #endif
2603 :
2604 : /* PyObjectCallNoArg.proto */
2605 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2606 :
2607 : /* PyObjectGetMethod.proto */
2608 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
2609 :
2610 : /* PyObjectCallMethod0.proto */
2611 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
2612 :
2613 : /* ValidateBasesTuple.proto */
2614 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
2615 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
2616 : #endif
2617 :
2618 : /* PyType_Ready.proto */
2619 : CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
2620 :
2621 : /* SetVTable.proto */
2622 : static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
2623 :
2624 : /* GetVTable.proto */
2625 : static void* __Pyx_GetVtable(PyTypeObject *type);
2626 :
2627 : /* MergeVTables.proto */
2628 : #if !CYTHON_COMPILING_IN_LIMITED_API
2629 : static int __Pyx_MergeVtables(PyTypeObject *type);
2630 : #endif
2631 :
2632 : /* SetupReduce.proto */
2633 : #if !CYTHON_COMPILING_IN_LIMITED_API
2634 : static int __Pyx_setup_reduce(PyObject* type_obj);
2635 : #endif
2636 :
2637 : /* TypeImport.proto */
2638 : #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
2639 : #define __PYX_HAVE_RT_ImportType_proto_3_0_11
2640 : #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2641 : #include <stdalign.h>
2642 : #endif
2643 : #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2644 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
2645 : #else
2646 : #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
2647 : #endif
2648 : enum __Pyx_ImportType_CheckSize_3_0_11 {
2649 : __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
2650 : __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
2651 : __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
2652 : };
2653 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
2654 : #endif
2655 :
2656 : /* FetchSharedCythonModule.proto */
2657 : static PyObject *__Pyx_FetchSharedCythonABIModule(void);
2658 :
2659 : /* FetchCommonType.proto */
2660 : #if !CYTHON_USE_TYPE_SPECS
2661 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2662 : #else
2663 : static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
2664 : #endif
2665 :
2666 : /* PyMethodNew.proto */
2667 : #if CYTHON_COMPILING_IN_LIMITED_API
2668 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2669 : PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
2670 : CYTHON_UNUSED_VAR(typ);
2671 : if (!self)
2672 : return __Pyx_NewRef(func);
2673 : typesModule = PyImport_ImportModule("types");
2674 : if (!typesModule) return NULL;
2675 : methodType = PyObject_GetAttrString(typesModule, "MethodType");
2676 : Py_DECREF(typesModule);
2677 : if (!methodType) return NULL;
2678 : result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
2679 : Py_DECREF(methodType);
2680 : return result;
2681 : }
2682 : #elif PY_MAJOR_VERSION >= 3
2683 0 : static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
2684 0 : CYTHON_UNUSED_VAR(typ);
2685 0 : if (!self)
2686 0 : return __Pyx_NewRef(func);
2687 0 : return PyMethod_New(func, self);
2688 : }
2689 : #else
2690 : #define __Pyx_PyMethod_New PyMethod_New
2691 : #endif
2692 :
2693 : /* PyVectorcallFastCallDict.proto */
2694 : #if CYTHON_METH_FASTCALL
2695 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
2696 : #endif
2697 :
2698 : /* CythonFunctionShared.proto */
2699 : #define __Pyx_CyFunction_USED
2700 : #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2701 : #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2702 : #define __Pyx_CYFUNCTION_CCLASS 0x04
2703 : #define __Pyx_CYFUNCTION_COROUTINE 0x08
2704 : #define __Pyx_CyFunction_GetClosure(f)\
2705 : (((__pyx_CyFunctionObject *) (f))->func_closure)
2706 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2707 : #define __Pyx_CyFunction_GetClassObj(f)\
2708 : (((__pyx_CyFunctionObject *) (f))->func_classobj)
2709 : #else
2710 : #define __Pyx_CyFunction_GetClassObj(f)\
2711 : ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
2712 : #endif
2713 : #define __Pyx_CyFunction_SetClassObj(f, classobj)\
2714 : __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
2715 : #define __Pyx_CyFunction_Defaults(type, f)\
2716 : ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2717 : #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2718 : ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2719 : typedef struct {
2720 : #if CYTHON_COMPILING_IN_LIMITED_API
2721 : PyObject_HEAD
2722 : PyObject *func;
2723 : #elif PY_VERSION_HEX < 0x030900B1
2724 : PyCFunctionObject func;
2725 : #else
2726 : PyCMethodObject func;
2727 : #endif
2728 : #if CYTHON_BACKPORT_VECTORCALL
2729 : __pyx_vectorcallfunc func_vectorcall;
2730 : #endif
2731 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
2732 : PyObject *func_weakreflist;
2733 : #endif
2734 : PyObject *func_dict;
2735 : PyObject *func_name;
2736 : PyObject *func_qualname;
2737 : PyObject *func_doc;
2738 : PyObject *func_globals;
2739 : PyObject *func_code;
2740 : PyObject *func_closure;
2741 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
2742 : PyObject *func_classobj;
2743 : #endif
2744 : void *defaults;
2745 : int defaults_pyobjects;
2746 : size_t defaults_size;
2747 : int flags;
2748 : PyObject *defaults_tuple;
2749 : PyObject *defaults_kwdict;
2750 : PyObject *(*defaults_getter)(PyObject *);
2751 : PyObject *func_annotations;
2752 : PyObject *func_is_coroutine;
2753 : } __pyx_CyFunctionObject;
2754 : #undef __Pyx_CyOrPyCFunction_Check
2755 : #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
2756 : #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
2757 : #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
2758 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
2759 : #undef __Pyx_IsSameCFunction
2760 : #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
2761 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2762 : int flags, PyObject* qualname,
2763 : PyObject *closure,
2764 : PyObject *module, PyObject *globals,
2765 : PyObject* code);
2766 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
2767 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2768 : size_t size,
2769 : int pyobjects);
2770 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2771 : PyObject *tuple);
2772 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2773 : PyObject *dict);
2774 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2775 : PyObject *dict);
2776 : static int __pyx_CyFunction_init(PyObject *module);
2777 : #if CYTHON_METH_FASTCALL
2778 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2779 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2780 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2781 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
2782 : #if CYTHON_BACKPORT_VECTORCALL
2783 : #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
2784 : #else
2785 : #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
2786 : #endif
2787 : #endif
2788 :
2789 : /* CythonFunction.proto */
2790 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2791 : int flags, PyObject* qualname,
2792 : PyObject *closure,
2793 : PyObject *module, PyObject *globals,
2794 : PyObject* code);
2795 :
2796 : /* Py3UpdateBases.proto */
2797 : static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
2798 :
2799 : /* CalculateMetaclass.proto */
2800 : static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
2801 :
2802 : /* PyObjectCall2Args.proto */
2803 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
2804 :
2805 : /* PyObjectLookupSpecial.proto */
2806 : #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2807 : #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
2808 : #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
2809 : static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
2810 : #else
2811 : #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
2812 : #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
2813 : #endif
2814 :
2815 : /* Py3ClassCreate.proto */
2816 : static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
2817 : PyObject *mkw, PyObject *modname, PyObject *doc);
2818 : static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
2819 : PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
2820 :
2821 : /* CLineInTraceback.proto */
2822 : #ifdef CYTHON_CLINE_IN_TRACEBACK
2823 : #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2824 : #else
2825 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2826 : #endif
2827 :
2828 : /* CodeObjectCache.proto */
2829 : #if !CYTHON_COMPILING_IN_LIMITED_API
2830 : typedef struct {
2831 : PyCodeObject* code_object;
2832 : int code_line;
2833 : } __Pyx_CodeObjectCacheEntry;
2834 : struct __Pyx_CodeObjectCache {
2835 : int count;
2836 : int max_count;
2837 : __Pyx_CodeObjectCacheEntry* entries;
2838 : };
2839 : static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2840 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2841 : static PyCodeObject *__pyx_find_code_object(int code_line);
2842 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2843 : #endif
2844 :
2845 : /* AddTraceback.proto */
2846 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
2847 : int py_line, const char *filename);
2848 :
2849 : #if PY_MAJOR_VERSION < 3
2850 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2851 : static void __Pyx_ReleaseBuffer(Py_buffer *view);
2852 : #else
2853 : #define __Pyx_GetBuffer PyObject_GetBuffer
2854 : #define __Pyx_ReleaseBuffer PyBuffer_Release
2855 : #endif
2856 :
2857 :
2858 : /* BufferStructDeclare.proto */
2859 : typedef struct {
2860 : Py_ssize_t shape, strides, suboffsets;
2861 : } __Pyx_Buf_DimInfo;
2862 : typedef struct {
2863 : size_t refcount;
2864 : Py_buffer pybuffer;
2865 : } __Pyx_Buffer;
2866 : typedef struct {
2867 : __Pyx_Buffer *rcbuffer;
2868 : char *data;
2869 : __Pyx_Buf_DimInfo diminfo[8];
2870 : } __Pyx_LocalBuf_ND;
2871 :
2872 : /* MemviewSliceIsContig.proto */
2873 : static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2874 :
2875 : /* OverlappingSlices.proto */
2876 : static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2877 : __Pyx_memviewslice *slice2,
2878 : int ndim, size_t itemsize);
2879 :
2880 : /* IsLittleEndian.proto */
2881 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2882 :
2883 : /* BufferFormatCheck.proto */
2884 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2885 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2886 : __Pyx_BufFmt_StackElem* stack,
2887 : __Pyx_TypeInfo* type);
2888 :
2889 : /* TypeInfoCompare.proto */
2890 : static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2891 :
2892 : /* MemviewSliceValidateAndInit.proto */
2893 : static int __Pyx_ValidateAndInit_memviewslice(
2894 : int *axes_specs,
2895 : int c_or_f_flag,
2896 : int buf_flags,
2897 : int ndim,
2898 : __Pyx_TypeInfo *dtype,
2899 : __Pyx_BufFmt_StackElem stack[],
2900 : __Pyx_memviewslice *memviewslice,
2901 : PyObject *original_obj);
2902 :
2903 : /* ObjectToMemviewSlice.proto */
2904 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t__const__(PyObject *, int writable_flag);
2905 :
2906 : /* ObjectToMemviewSlice.proto */
2907 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t__const__(PyObject *, int writable_flag);
2908 :
2909 : /* ObjectToMemviewSlice.proto */
2910 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(PyObject *, int writable_flag);
2911 :
2912 : /* MemviewDtypeToObject.proto */
2913 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_intp_t(const char *itemp);
2914 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_intp_t(const char *itemp, PyObject *obj);
2915 :
2916 : /* ObjectToMemviewSlice.proto */
2917 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject *, int writable_flag);
2918 :
2919 : /* MemviewDtypeToObject.proto */
2920 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t__const__(const char *itemp);
2921 :
2922 : /* MemviewDtypeToObject.proto */
2923 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp);
2924 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj);
2925 :
2926 : /* ObjectToMemviewSlice.proto */
2927 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(PyObject *, int writable_flag);
2928 :
2929 : /* MemviewDtypeToObject.proto */
2930 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp);
2931 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj);
2932 :
2933 : /* RealImag.proto */
2934 : #if CYTHON_CCOMPLEX
2935 : #ifdef __cplusplus
2936 : #define __Pyx_CREAL(z) ((z).real())
2937 : #define __Pyx_CIMAG(z) ((z).imag())
2938 : #else
2939 : #define __Pyx_CREAL(z) (__real__(z))
2940 : #define __Pyx_CIMAG(z) (__imag__(z))
2941 : #endif
2942 : #else
2943 : #define __Pyx_CREAL(z) ((z).real)
2944 : #define __Pyx_CIMAG(z) ((z).imag)
2945 : #endif
2946 : #if defined(__cplusplus) && CYTHON_CCOMPLEX\
2947 : && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
2948 : #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2949 : #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2950 : #else
2951 : #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2952 : #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2953 : #endif
2954 :
2955 : /* Arithmetic.proto */
2956 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2957 : #define __Pyx_c_eq_float(a, b) ((a)==(b))
2958 : #define __Pyx_c_sum_float(a, b) ((a)+(b))
2959 : #define __Pyx_c_diff_float(a, b) ((a)-(b))
2960 : #define __Pyx_c_prod_float(a, b) ((a)*(b))
2961 : #define __Pyx_c_quot_float(a, b) ((a)/(b))
2962 : #define __Pyx_c_neg_float(a) (-(a))
2963 : #ifdef __cplusplus
2964 : #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2965 : #define __Pyx_c_conj_float(z) (::std::conj(z))
2966 : #if 1
2967 : #define __Pyx_c_abs_float(z) (::std::abs(z))
2968 : #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2969 : #endif
2970 : #else
2971 : #define __Pyx_c_is_zero_float(z) ((z)==0)
2972 : #define __Pyx_c_conj_float(z) (conjf(z))
2973 : #if 1
2974 : #define __Pyx_c_abs_float(z) (cabsf(z))
2975 : #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2976 : #endif
2977 : #endif
2978 : #else
2979 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2980 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2981 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2982 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2983 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2984 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2985 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2986 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2987 : #if 1
2988 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2989 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2990 : #endif
2991 : #endif
2992 :
2993 : /* Arithmetic.proto */
2994 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
2995 : #define __Pyx_c_eq_double(a, b) ((a)==(b))
2996 : #define __Pyx_c_sum_double(a, b) ((a)+(b))
2997 : #define __Pyx_c_diff_double(a, b) ((a)-(b))
2998 : #define __Pyx_c_prod_double(a, b) ((a)*(b))
2999 : #define __Pyx_c_quot_double(a, b) ((a)/(b))
3000 : #define __Pyx_c_neg_double(a) (-(a))
3001 : #ifdef __cplusplus
3002 : #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
3003 : #define __Pyx_c_conj_double(z) (::std::conj(z))
3004 : #if 1
3005 : #define __Pyx_c_abs_double(z) (::std::abs(z))
3006 : #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
3007 : #endif
3008 : #else
3009 : #define __Pyx_c_is_zero_double(z) ((z)==0)
3010 : #define __Pyx_c_conj_double(z) (conj(z))
3011 : #if 1
3012 : #define __Pyx_c_abs_double(z) (cabs(z))
3013 : #define __Pyx_c_pow_double(a, b) (cpow(a, b))
3014 : #endif
3015 : #endif
3016 : #else
3017 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
3018 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
3019 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
3020 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
3021 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
3022 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
3023 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
3024 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
3025 : #if 1
3026 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
3027 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
3028 : #endif
3029 : #endif
3030 :
3031 : /* Arithmetic.proto */
3032 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
3033 : #define __Pyx_c_eq_long__double(a, b) ((a)==(b))
3034 : #define __Pyx_c_sum_long__double(a, b) ((a)+(b))
3035 : #define __Pyx_c_diff_long__double(a, b) ((a)-(b))
3036 : #define __Pyx_c_prod_long__double(a, b) ((a)*(b))
3037 : #define __Pyx_c_quot_long__double(a, b) ((a)/(b))
3038 : #define __Pyx_c_neg_long__double(a) (-(a))
3039 : #ifdef __cplusplus
3040 : #define __Pyx_c_is_zero_long__double(z) ((z)==(long double)0)
3041 : #define __Pyx_c_conj_long__double(z) (::std::conj(z))
3042 : #if 1
3043 : #define __Pyx_c_abs_long__double(z) (::std::abs(z))
3044 : #define __Pyx_c_pow_long__double(a, b) (::std::pow(a, b))
3045 : #endif
3046 : #else
3047 : #define __Pyx_c_is_zero_long__double(z) ((z)==0)
3048 : #define __Pyx_c_conj_long__double(z) (conjl(z))
3049 : #if 1
3050 : #define __Pyx_c_abs_long__double(z) (cabsl(z))
3051 : #define __Pyx_c_pow_long__double(a, b) (cpowl(a, b))
3052 : #endif
3053 : #endif
3054 : #else
3055 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3056 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3057 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3058 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3059 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3060 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex);
3061 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex);
3062 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex);
3063 : #if 1
3064 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex);
3065 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex, __pyx_t_long_double_complex);
3066 : #endif
3067 : #endif
3068 :
3069 : /* MemviewSliceCopyTemplate.proto */
3070 : static __Pyx_memviewslice
3071 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
3072 : const char *mode, int ndim,
3073 : size_t sizeof_dtype, int contig_flag,
3074 : int dtype_is_object);
3075 :
3076 : /* MemviewSliceInit.proto */
3077 : #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3078 : #define __Pyx_MEMVIEW_DIRECT 1
3079 : #define __Pyx_MEMVIEW_PTR 2
3080 : #define __Pyx_MEMVIEW_FULL 4
3081 : #define __Pyx_MEMVIEW_CONTIG 8
3082 : #define __Pyx_MEMVIEW_STRIDED 16
3083 : #define __Pyx_MEMVIEW_FOLLOW 32
3084 : #define __Pyx_IS_C_CONTIG 1
3085 : #define __Pyx_IS_F_CONTIG 2
3086 : static int __Pyx_init_memviewslice(
3087 : struct __pyx_memoryview_obj *memview,
3088 : int ndim,
3089 : __Pyx_memviewslice *memviewslice,
3090 : int memview_is_new_reference);
3091 : static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
3092 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3093 : static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
3094 : __pyx_atomic_int_type *acquisition_count, PyThread_type_lock lock);
3095 : #define __pyx_get_slice_count_pointer(memview) (&memview->acquisition_count)
3096 : #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
3097 : #define __PYX_XCLEAR_MEMVIEW(slice, have_gil) __Pyx_XCLEAR_MEMVIEW(slice, have_gil, __LINE__)
3098 : static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
3099 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *, int, int);
3100 :
3101 : /* CIntFromPy.proto */
3102 : static CYTHON_INLINE npy_intp __Pyx_PyInt_As_npy_intp(PyObject *);
3103 :
3104 : /* CIntToPy.proto */
3105 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value);
3106 :
3107 : /* CIntToPy.proto */
3108 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value);
3109 :
3110 : /* CIntFromPy.proto */
3111 : static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *);
3112 :
3113 : /* CIntFromPy.proto */
3114 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3115 :
3116 : /* CIntFromPy.proto */
3117 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
3118 :
3119 : /* CIntToPy.proto */
3120 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
3121 :
3122 : /* CIntToPy.proto */
3123 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
3124 :
3125 : /* CIntFromPy.proto */
3126 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
3127 :
3128 : /* FormatTypeName.proto */
3129 : #if CYTHON_COMPILING_IN_LIMITED_API
3130 : typedef PyObject *__Pyx_TypeName;
3131 : #define __Pyx_FMT_TYPENAME "%U"
3132 : static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
3133 : #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
3134 : #else
3135 : typedef const char *__Pyx_TypeName;
3136 : #define __Pyx_FMT_TYPENAME "%.200s"
3137 : #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
3138 : #define __Pyx_DECREF_TypeName(obj)
3139 : #endif
3140 :
3141 : /* CheckBinaryVersion.proto */
3142 : static unsigned long __Pyx_get_runtime_version(void);
3143 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
3144 :
3145 : /* InitStrings.proto */
3146 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
3147 :
3148 : /* #### Code section: module_declarations ### */
3149 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
3150 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
3151 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
3152 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
3153 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
3154 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
3155 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3156 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3157 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self); /* proto*/
3158 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
3159 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
3160 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/
3161 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self); /* proto*/
3162 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self); /* proto*/
3163 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self); /* proto*/
3164 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self); /* proto*/
3165 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self); /* proto*/
3166 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self); /* proto*/
3167 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3168 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3169 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3170 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3171 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3172 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self); /* proto*/
3173 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self); /* proto*/
3174 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self); /* proto*/
3175 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self); /* proto*/
3176 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self); /* proto*/
3177 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self); /* proto*/
3178 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3179 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3180 :
3181 : /* Module declarations from "libc.string" */
3182 :
3183 : /* Module declarations from "libc.stdio" */
3184 :
3185 : /* Module declarations from "__builtin__" */
3186 :
3187 : /* Module declarations from "cpython.type" */
3188 :
3189 : /* Module declarations from "cpython" */
3190 :
3191 : /* Module declarations from "cpython.object" */
3192 :
3193 : /* Module declarations from "cpython.ref" */
3194 :
3195 : /* Module declarations from "numpy" */
3196 :
3197 : /* Module declarations from "numpy" */
3198 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
3199 :
3200 : /* Module declarations from "libc.math" */
3201 :
3202 : /* Module declarations from "scipy.signal._peak_finding_utils" */
3203 : static PyObject *__pyx_collections_abc_Sequence = 0;
3204 : static PyObject *generic = 0;
3205 : static PyObject *strided = 0;
3206 : static PyObject *indirect = 0;
3207 : static PyObject *contiguous = 0;
3208 : static PyObject *indirect_contiguous = 0;
3209 : static int __pyx_memoryview_thread_locks_used;
3210 : static PyThread_type_lock __pyx_memoryview_thread_locks[8];
3211 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/
3212 : static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
3213 : static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
3214 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
3215 : static PyObject *_unellipsify(PyObject *, int); /*proto*/
3216 : static int assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
3217 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
3218 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
3219 : static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
3220 : static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
3221 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
3222 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3223 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3224 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
3225 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
3226 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
3227 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
3228 : static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
3229 : static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
3230 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
3231 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
3232 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
3233 : static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
3234 : static int __pyx_memoryview_err_dim(PyObject *, PyObject *, int); /*proto*/
3235 : static int __pyx_memoryview_err(PyObject *, PyObject *); /*proto*/
3236 : static int __pyx_memoryview_err_no_memory(void); /*proto*/
3237 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
3238 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
3239 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
3240 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3241 : static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
3242 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
3243 : static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
3244 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
3245 : /* #### Code section: typeinfo ### */
3246 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t__const__ = { "const float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t const ), { 0 }, 0, 'R', 0, 0 };
3247 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t__const__ = { "const intp_t", NULL, sizeof(__pyx_t_5numpy_intp_t const ), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_intp_t const ) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_intp_t const ), 0 };
3248 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t = { "intp_t", NULL, sizeof(__pyx_t_5numpy_intp_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_intp_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_intp_t), 0 };
3249 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t = { "uint8_t", NULL, sizeof(__pyx_t_5numpy_uint8_t), { 0 }, 0, __PYX_IS_UNSIGNED(__pyx_t_5numpy_uint8_t) ? 'U' : 'I', __PYX_IS_UNSIGNED(__pyx_t_5numpy_uint8_t), 0 };
3250 : static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t = { "float64_t", NULL, sizeof(__pyx_t_5numpy_float64_t), { 0 }, 0, 'R', 0, 0 };
3251 : /* #### Code section: before_global_var ### */
3252 : #define __Pyx_MODULE_NAME "scipy.signal._peak_finding_utils"
3253 : extern int __pyx_module_is_main_scipy__signal___peak_finding_utils;
3254 : int __pyx_module_is_main_scipy__signal___peak_finding_utils = 0;
3255 :
3256 : /* Implementation of "scipy.signal._peak_finding_utils" */
3257 : /* #### Code section: global_var ### */
3258 : static PyObject *__pyx_builtin_RuntimeWarning;
3259 : static PyObject *__pyx_builtin_range;
3260 : static PyObject *__pyx_builtin_ValueError;
3261 : static PyObject *__pyx_builtin___import__;
3262 : static PyObject *__pyx_builtin_MemoryError;
3263 : static PyObject *__pyx_builtin_enumerate;
3264 : static PyObject *__pyx_builtin_TypeError;
3265 : static PyObject *__pyx_builtin_AssertionError;
3266 : static PyObject *__pyx_builtin_Ellipsis;
3267 : static PyObject *__pyx_builtin_id;
3268 : static PyObject *__pyx_builtin_IndexError;
3269 : static PyObject *__pyx_builtin_ImportError;
3270 : /* #### Code section: string_decls ### */
3271 : static const char __pyx_k_[] = ": ";
3272 : static const char __pyx_k_O[] = "O";
3273 : static const char __pyx_k_c[] = "c";
3274 : static const char __pyx_k_i[] = "i";
3275 : static const char __pyx_k_j[] = "j";
3276 : static const char __pyx_k_k[] = "k";
3277 : static const char __pyx_k_m[] = "m";
3278 : static const char __pyx_k_p[] = "p";
3279 : static const char __pyx_k_x[] = "x";
3280 : static const char __pyx_k__2[] = ".";
3281 : static const char __pyx_k__3[] = "*";
3282 : static const char __pyx_k__6[] = "'";
3283 : static const char __pyx_k__7[] = ")";
3284 : static const char __pyx_k_gc[] = "gc";
3285 : static const char __pyx_k_id[] = "id";
3286 : static const char __pyx_k_np[] = "np";
3287 : static const char __pyx_k__34[] = "?";
3288 : static const char __pyx_k_abc[] = "abc";
3289 : static const char __pyx_k_all[] = "__all__";
3290 : static const char __pyx_k_and[] = " and ";
3291 : static const char __pyx_k_doc[] = "__doc__";
3292 : static const char __pyx_k_got[] = " (got ";
3293 : static const char __pyx_k_new[] = "__new__";
3294 : static const char __pyx_k_obj[] = "obj";
3295 : static const char __pyx_k_sys[] = "sys";
3296 : static const char __pyx_k_base[] = "base";
3297 : static const char __pyx_k_bool[] = "bool_";
3298 : static const char __pyx_k_dict[] = "__dict__";
3299 : static const char __pyx_k_intp[] = "intp";
3300 : static const char __pyx_k_keep[] = "keep";
3301 : static const char __pyx_k_main[] = "__main__";
3302 : static const char __pyx_k_mode[] = "mode";
3303 : static const char __pyx_k_name[] = "name";
3304 : static const char __pyx_k_ndim[] = "ndim";
3305 : static const char __pyx_k_ones[] = "ones";
3306 : static const char __pyx_k_pack[] = "pack";
3307 : static const char __pyx_k_peak[] = "peak";
3308 : static const char __pyx_k_size[] = "size";
3309 : static const char __pyx_k_spec[] = "__spec__";
3310 : static const char __pyx_k_step[] = "step";
3311 : static const char __pyx_k_stop[] = "stop";
3312 : static const char __pyx_k_test[] = "__test__";
3313 : static const char __pyx_k_view[] = "view";
3314 : static const char __pyx_k_warn[] = "warn";
3315 : static const char __pyx_k_wlen[] = "wlen";
3316 : static const char __pyx_k_ASCII[] = "ASCII";
3317 : static const char __pyx_k_class[] = "__class__";
3318 : static const char __pyx_k_count[] = "count";
3319 : static const char __pyx_k_dtype[] = "dtype";
3320 : static const char __pyx_k_empty[] = "empty";
3321 : static const char __pyx_k_error[] = "error";
3322 : static const char __pyx_k_flags[] = "flags";
3323 : static const char __pyx_k_i_max[] = "i_max";
3324 : static const char __pyx_k_i_min[] = "i_min";
3325 : static const char __pyx_k_index[] = "index";
3326 : static const char __pyx_k_numpy[] = "numpy";
3327 : static const char __pyx_k_peaks[] = "peaks";
3328 : static const char __pyx_k_range[] = "range";
3329 : static const char __pyx_k_shape[] = "shape";
3330 : static const char __pyx_k_start[] = "start";
3331 : static const char __pyx_k_super[] = "super";
3332 : static const char __pyx_k_uint8[] = "uint8";
3333 : static const char __pyx_k_enable[] = "enable";
3334 : static const char __pyx_k_encode[] = "encode";
3335 : static const char __pyx_k_format[] = "format";
3336 : static const char __pyx_k_height[] = "height";
3337 : static const char __pyx_k_import[] = "__import__";
3338 : static const char __pyx_k_module[] = "__module__";
3339 : static const char __pyx_k_name_2[] = "__name__";
3340 : static const char __pyx_k_pickle[] = "pickle";
3341 : static const char __pyx_k_reduce[] = "__reduce__";
3342 : static const char __pyx_k_resize[] = "resize";
3343 : static const char __pyx_k_struct[] = "struct";
3344 : static const char __pyx_k_unpack[] = "unpack";
3345 : static const char __pyx_k_update[] = "update";
3346 : static const char __pyx_k_widths[] = "widths";
3347 : static const char __pyx_k_argsort[] = "argsort";
3348 : static const char __pyx_k_disable[] = "disable";
3349 : static const char __pyx_k_float64[] = "float64";
3350 : static const char __pyx_k_fortran[] = "fortran";
3351 : static const char __pyx_k_i_ahead[] = "i_ahead";
3352 : static const char __pyx_k_left_ip[] = "left_ip";
3353 : static const char __pyx_k_memview[] = "memview";
3354 : static const char __pyx_k_peak_nr[] = "peak_nr";
3355 : static const char __pyx_k_prepare[] = "__prepare__";
3356 : static const char __pyx_k_Ellipsis[] = "Ellipsis";
3357 : static const char __pyx_k_Sequence[] = "Sequence";
3358 : static const char __pyx_k_distance[] = "distance";
3359 : static const char __pyx_k_getstate[] = "__getstate__";
3360 : static const char __pyx_k_itemsize[] = "itemsize";
3361 : static const char __pyx_k_left_ips[] = "left_ips";
3362 : static const char __pyx_k_left_min[] = "left_min";
3363 : static const char __pyx_k_priority[] = "priority";
3364 : static const char __pyx_k_pyx_type[] = "__pyx_type";
3365 : static const char __pyx_k_qualname[] = "__qualname__";
3366 : static const char __pyx_k_refcheck[] = "refcheck";
3367 : static const char __pyx_k_register[] = "register";
3368 : static const char __pyx_k_right_ip[] = "right_ip";
3369 : static const char __pyx_k_set_name[] = "__set_name__";
3370 : static const char __pyx_k_setstate[] = "__setstate__";
3371 : static const char __pyx_k_warnings[] = "warnings";
3372 : static const char __pyx_k_TypeError[] = "TypeError";
3373 : static const char __pyx_k_enumerate[] = "enumerate";
3374 : static const char __pyx_k_isenabled[] = "isenabled";
3375 : static const char __pyx_k_metaclass[] = "__metaclass__";
3376 : static const char __pyx_k_midpoints[] = "midpoints";
3377 : static const char __pyx_k_pyx_state[] = "__pyx_state";
3378 : static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
3379 : static const char __pyx_k_right_ips[] = "right_ips";
3380 : static const char __pyx_k_right_min[] = "right_min";
3381 : static const char __pyx_k_IndexError[] = "IndexError";
3382 : static const char __pyx_k_ValueError[] = "ValueError";
3383 : static const char __pyx_k_distance_2[] = "distance_";
3384 : static const char __pyx_k_left_bases[] = "left_bases";
3385 : static const char __pyx_k_left_edges[] = "left_edges";
3386 : static const char __pyx_k_peaks_size[] = "peaks_size";
3387 : static const char __pyx_k_pyx_result[] = "__pyx_result";
3388 : static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
3389 : static const char __pyx_k_rel_height[] = "rel_height";
3390 : static const char __pyx_k_stacklevel[] = "stacklevel";
3391 : static const char __pyx_k_ImportError[] = "ImportError";
3392 : static const char __pyx_k_MemoryError[] = "MemoryError";
3393 : static const char __pyx_k_PickleError[] = "PickleError";
3394 : static const char __pyx_k_collections[] = "collections";
3395 : static const char __pyx_k_mro_entries[] = "__mro_entries__";
3396 : static const char __pyx_k_peak_widths[] = "_peak_widths";
3397 : static const char __pyx_k_prominences[] = "prominences";
3398 : static const char __pyx_k_right_bases[] = "right_bases";
3399 : static const char __pyx_k_right_edges[] = "right_edges";
3400 : static const char __pyx_k_initializing[] = "_initializing";
3401 : static const char __pyx_k_is_coroutine[] = "_is_coroutine";
3402 : static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
3403 : static const char __pyx_k_show_warning[] = "show_warning";
3404 : static const char __pyx_k_stringsource[] = "<stringsource>";
3405 : static const char __pyx_k_version_info[] = "version_info";
3406 : static const char __pyx_k_class_getitem[] = "__class_getitem__";
3407 : static const char __pyx_k_init_subclass[] = "__init_subclass__";
3408 : static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
3409 : static const char __pyx_k_width_heights[] = "width_heights";
3410 : static const char __pyx_k_AssertionError[] = "AssertionError";
3411 : static const char __pyx_k_RuntimeWarning[] = "RuntimeWarning";
3412 : static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
3413 : static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
3414 : static const char __pyx_k_collections_abc[] = "collections.abc";
3415 : static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
3416 : static const char __pyx_k_local_maxima_1d[] = "_local_maxima_1d";
3417 : static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
3418 : static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
3419 : static const char __pyx_k_peak_prominences[] = "_peak_prominences";
3420 : static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
3421 : static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
3422 : static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
3423 : static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
3424 : static const char __pyx_k_PeakPropertyWarning[] = "PeakPropertyWarning";
3425 : static const char __pyx_k_priority_to_position[] = "priority_to_position";
3426 : static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
3427 : static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis ";
3428 : static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
3429 : static const char __pyx_k_Cannot_index_with_type[] = "Cannot index with type '";
3430 : static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
3431 : static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
3432 : static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
3433 : static const char __pyx_k_select_by_peak_distance[] = "_select_by_peak_distance";
3434 : static const char __pyx_k_Dimension_d_is_not_direct[] = "Dimension %d is not direct";
3435 : static const char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
3436 : static const char __pyx_k_Step_may_not_be_zero_axis_d[] = "Step may not be zero (axis %d)";
3437 : static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
3438 : static const char __pyx_k_some_peaks_have_a_width_of_0[] = "some peaks have a width of 0";
3439 : static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
3440 : static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
3441 : static const char __pyx_k_home_czgdp18079_Quansight_scipy[] = "/home/czgdp18079/Quansight/scipy/scipy/signal/_peak_finding_utils.pyx";
3442 : static const char __pyx_k_peak_is_not_a_valid_index_for_x[] = "peak {} is not a valid index for `x`";
3443 : static const char __pyx_k_rel_height_must_be_greater_or_e[] = "`rel_height` must be greater or equal to 0.0";
3444 : static const char __pyx_k_some_peaks_have_a_prominence_of[] = "some peaks have a prominence of 0";
3445 : static const char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
3446 : static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
3447 : static const char __pyx_k_Calculated_property_of_a_peak_ha[] = "Calculated property of a peak has unexpected value.";
3448 : static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
3449 : static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
3450 : static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
3451 : static const char __pyx_k_Cannot_transpose_memoryview_with[] = "Cannot transpose memoryview with indirect dimensions";
3452 : static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
3453 : static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))";
3454 : static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
3455 : static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got ";
3456 : static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis ";
3457 : static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
3458 : static const char __pyx_k_Utility_functions_for_finding_pe[] = "Utility functions for finding peaks in signals.";
3459 : static const char __pyx_k_arrays_in_prominence_data_must_h[] = "arrays in `prominence_data` must have the same shape as `peaks`";
3460 : static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension ";
3461 : static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
3462 : static const char __pyx_k_numpy__core_multiarray_failed_to[] = "numpy._core.multiarray failed to import";
3463 : static const char __pyx_k_numpy__core_umath_failed_to_impo[] = "numpy._core.umath failed to import";
3464 : static const char __pyx_k_prominence_data_is_invalid_for_p[] = "prominence data is invalid for peak {}";
3465 : static const char __pyx_k_scipy_signal__peak_finding_utils[] = "scipy.signal._peak_finding_utils";
3466 : static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
3467 : /* #### Code section: decls ### */
3468 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
3469 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3470 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3471 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3472 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
3473 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
3474 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
3475 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
3476 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
3477 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3478 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
3479 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3480 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
3481 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
3482 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
3483 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3484 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
3485 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
3486 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
3487 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3488 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3489 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3490 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3491 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3492 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3493 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3494 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3495 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3496 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3497 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3498 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3499 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3500 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3501 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3502 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3503 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
3504 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3505 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3506 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
3507 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
3508 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
3509 : static PyObject *__pyx_pf_5scipy_6signal_19_peak_finding_utils__local_maxima_1d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x); /* proto */
3510 : static PyObject *__pyx_pf_5scipy_6signal_19_peak_finding_utils_2_select_by_peak_distance(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_peaks, __Pyx_memviewslice __pyx_v_priority, __pyx_t_5numpy_float64_t __pyx_v_distance); /* proto */
3511 : static PyObject *__pyx_pf_5scipy_6signal_19_peak_finding_utils_4_peak_prominences(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_peaks, __pyx_t_5numpy_intp_t __pyx_v_wlen); /* proto */
3512 : static PyObject *__pyx_pf_5scipy_6signal_19_peak_finding_utils_6_peak_widths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_peaks, __pyx_t_5numpy_float64_t __pyx_v_rel_height, __Pyx_memviewslice __pyx_v_prominences, __Pyx_memviewslice __pyx_v_left_bases, __Pyx_memviewslice __pyx_v_right_bases); /* proto */
3513 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3514 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3515 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3516 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
3517 : /* #### Code section: late_includes ### */
3518 : /* #### Code section: module_state ### */
3519 : typedef struct {
3520 : PyObject *__pyx_d;
3521 : PyObject *__pyx_b;
3522 : PyObject *__pyx_cython_runtime;
3523 : PyObject *__pyx_empty_tuple;
3524 : PyObject *__pyx_empty_bytes;
3525 : PyObject *__pyx_empty_unicode;
3526 : #ifdef __Pyx_CyFunction_USED
3527 : PyTypeObject *__pyx_CyFunctionType;
3528 : #endif
3529 : #ifdef __Pyx_FusedFunction_USED
3530 : PyTypeObject *__pyx_FusedFunctionType;
3531 : #endif
3532 : #ifdef __Pyx_Generator_USED
3533 : PyTypeObject *__pyx_GeneratorType;
3534 : #endif
3535 : #ifdef __Pyx_IterableCoroutine_USED
3536 : PyTypeObject *__pyx_IterableCoroutineType;
3537 : #endif
3538 : #ifdef __Pyx_Coroutine_USED
3539 : PyTypeObject *__pyx_CoroutineAwaitType;
3540 : #endif
3541 : #ifdef __Pyx_Coroutine_USED
3542 : PyTypeObject *__pyx_CoroutineType;
3543 : #endif
3544 : #if CYTHON_USE_MODULE_STATE
3545 : #endif
3546 : #if CYTHON_USE_MODULE_STATE
3547 : #endif
3548 : #if CYTHON_USE_MODULE_STATE
3549 : #endif
3550 : #if CYTHON_USE_MODULE_STATE
3551 : #endif
3552 : PyTypeObject *__pyx_ptype_7cpython_4type_type;
3553 : #if CYTHON_USE_MODULE_STATE
3554 : #endif
3555 : #if CYTHON_USE_MODULE_STATE
3556 : #endif
3557 : #if CYTHON_USE_MODULE_STATE
3558 : #endif
3559 : #if CYTHON_USE_MODULE_STATE
3560 : #endif
3561 : #if CYTHON_USE_MODULE_STATE
3562 : #endif
3563 : PyTypeObject *__pyx_ptype_5numpy_dtype;
3564 : PyTypeObject *__pyx_ptype_5numpy_flatiter;
3565 : PyTypeObject *__pyx_ptype_5numpy_broadcast;
3566 : PyTypeObject *__pyx_ptype_5numpy_ndarray;
3567 : PyTypeObject *__pyx_ptype_5numpy_generic;
3568 : PyTypeObject *__pyx_ptype_5numpy_number;
3569 : PyTypeObject *__pyx_ptype_5numpy_integer;
3570 : PyTypeObject *__pyx_ptype_5numpy_signedinteger;
3571 : PyTypeObject *__pyx_ptype_5numpy_unsignedinteger;
3572 : PyTypeObject *__pyx_ptype_5numpy_inexact;
3573 : PyTypeObject *__pyx_ptype_5numpy_floating;
3574 : PyTypeObject *__pyx_ptype_5numpy_complexfloating;
3575 : PyTypeObject *__pyx_ptype_5numpy_flexible;
3576 : PyTypeObject *__pyx_ptype_5numpy_character;
3577 : PyTypeObject *__pyx_ptype_5numpy_ufunc;
3578 : #if CYTHON_USE_MODULE_STATE
3579 : #endif
3580 : #if CYTHON_USE_MODULE_STATE
3581 : PyObject *__pyx_type___pyx_array;
3582 : PyObject *__pyx_type___pyx_MemviewEnum;
3583 : PyObject *__pyx_type___pyx_memoryview;
3584 : PyObject *__pyx_type___pyx_memoryviewslice;
3585 : #endif
3586 : PyTypeObject *__pyx_array_type;
3587 : PyTypeObject *__pyx_MemviewEnum_type;
3588 : PyTypeObject *__pyx_memoryview_type;
3589 : PyTypeObject *__pyx_memoryviewslice_type;
3590 : PyObject *__pyx_kp_u_;
3591 : PyObject *__pyx_n_s_ASCII;
3592 : PyObject *__pyx_kp_s_All_dimensions_preceding_dimensi;
3593 : PyObject *__pyx_n_s_AssertionError;
3594 : PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
3595 : PyObject *__pyx_kp_s_Calculated_property_of_a_peak_ha;
3596 : PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
3597 : PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
3598 : PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
3599 : PyObject *__pyx_kp_u_Cannot_index_with_type;
3600 : PyObject *__pyx_kp_s_Cannot_transpose_memoryview_with;
3601 : PyObject *__pyx_kp_s_Dimension_d_is_not_direct;
3602 : PyObject *__pyx_n_s_Ellipsis;
3603 : PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
3604 : PyObject *__pyx_n_s_ImportError;
3605 : PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
3606 : PyObject *__pyx_n_s_IndexError;
3607 : PyObject *__pyx_kp_s_Index_out_of_bounds_axis_d;
3608 : PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
3609 : PyObject *__pyx_kp_u_Invalid_mode_expected_c_or_fortr;
3610 : PyObject *__pyx_kp_u_Invalid_shape_in_axis;
3611 : PyObject *__pyx_n_s_MemoryError;
3612 : PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
3613 : PyObject *__pyx_kp_s_MemoryView_of_r_object;
3614 : PyObject *__pyx_n_b_O;
3615 : PyObject *__pyx_kp_u_Out_of_bounds_on_buffer_access_a;
3616 : PyObject *__pyx_n_s_PeakPropertyWarning;
3617 : PyObject *__pyx_n_s_PickleError;
3618 : PyObject *__pyx_n_s_RuntimeWarning;
3619 : PyObject *__pyx_n_s_Sequence;
3620 : PyObject *__pyx_kp_s_Step_may_not_be_zero_axis_d;
3621 : PyObject *__pyx_n_s_TypeError;
3622 : PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
3623 : PyObject *__pyx_n_s_ValueError;
3624 : PyObject *__pyx_n_s_View_MemoryView;
3625 : PyObject *__pyx_kp_u__2;
3626 : PyObject *__pyx_n_s__3;
3627 : PyObject *__pyx_n_s__34;
3628 : PyObject *__pyx_kp_u__6;
3629 : PyObject *__pyx_kp_u__7;
3630 : PyObject *__pyx_n_s_abc;
3631 : PyObject *__pyx_n_s_all;
3632 : PyObject *__pyx_n_s_allocate_buffer;
3633 : PyObject *__pyx_kp_u_and;
3634 : PyObject *__pyx_n_s_argsort;
3635 : PyObject *__pyx_kp_u_arrays_in_prominence_data_must_h;
3636 : PyObject *__pyx_n_s_asyncio_coroutines;
3637 : PyObject *__pyx_n_s_base;
3638 : PyObject *__pyx_n_s_bool;
3639 : PyObject *__pyx_n_s_c;
3640 : PyObject *__pyx_n_u_c;
3641 : PyObject *__pyx_n_s_class;
3642 : PyObject *__pyx_n_s_class_getitem;
3643 : PyObject *__pyx_n_s_cline_in_traceback;
3644 : PyObject *__pyx_n_s_collections;
3645 : PyObject *__pyx_kp_s_collections_abc;
3646 : PyObject *__pyx_kp_s_contiguous_and_direct;
3647 : PyObject *__pyx_kp_s_contiguous_and_indirect;
3648 : PyObject *__pyx_n_s_count;
3649 : PyObject *__pyx_n_s_dict;
3650 : PyObject *__pyx_kp_u_disable;
3651 : PyObject *__pyx_n_s_distance;
3652 : PyObject *__pyx_n_s_distance_2;
3653 : PyObject *__pyx_n_s_doc;
3654 : PyObject *__pyx_n_s_dtype;
3655 : PyObject *__pyx_n_s_dtype_is_object;
3656 : PyObject *__pyx_n_s_empty;
3657 : PyObject *__pyx_kp_u_enable;
3658 : PyObject *__pyx_n_s_encode;
3659 : PyObject *__pyx_n_s_enumerate;
3660 : PyObject *__pyx_n_s_error;
3661 : PyObject *__pyx_n_s_flags;
3662 : PyObject *__pyx_n_s_float64;
3663 : PyObject *__pyx_n_s_format;
3664 : PyObject *__pyx_n_s_fortran;
3665 : PyObject *__pyx_n_u_fortran;
3666 : PyObject *__pyx_kp_u_gc;
3667 : PyObject *__pyx_n_s_getstate;
3668 : PyObject *__pyx_kp_u_got;
3669 : PyObject *__pyx_kp_u_got_differing_extents_in_dimensi;
3670 : PyObject *__pyx_n_s_height;
3671 : PyObject *__pyx_kp_s_home_czgdp18079_Quansight_scipy;
3672 : PyObject *__pyx_n_s_i;
3673 : PyObject *__pyx_n_s_i_ahead;
3674 : PyObject *__pyx_n_s_i_max;
3675 : PyObject *__pyx_n_s_i_min;
3676 : PyObject *__pyx_n_s_id;
3677 : PyObject *__pyx_n_s_import;
3678 : PyObject *__pyx_n_s_index;
3679 : PyObject *__pyx_n_s_init_subclass;
3680 : PyObject *__pyx_n_s_initializing;
3681 : PyObject *__pyx_n_s_intp;
3682 : PyObject *__pyx_n_s_is_coroutine;
3683 : PyObject *__pyx_kp_u_isenabled;
3684 : PyObject *__pyx_n_s_itemsize;
3685 : PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
3686 : PyObject *__pyx_n_s_j;
3687 : PyObject *__pyx_n_s_k;
3688 : PyObject *__pyx_n_s_keep;
3689 : PyObject *__pyx_n_s_left_bases;
3690 : PyObject *__pyx_n_s_left_edges;
3691 : PyObject *__pyx_n_s_left_ip;
3692 : PyObject *__pyx_n_s_left_ips;
3693 : PyObject *__pyx_n_s_left_min;
3694 : PyObject *__pyx_n_s_local_maxima_1d;
3695 : PyObject *__pyx_n_u_local_maxima_1d;
3696 : PyObject *__pyx_n_s_m;
3697 : PyObject *__pyx_n_s_main;
3698 : PyObject *__pyx_n_s_memview;
3699 : PyObject *__pyx_n_s_metaclass;
3700 : PyObject *__pyx_n_s_midpoints;
3701 : PyObject *__pyx_n_s_mode;
3702 : PyObject *__pyx_n_s_module;
3703 : PyObject *__pyx_n_s_mro_entries;
3704 : PyObject *__pyx_n_s_name;
3705 : PyObject *__pyx_n_s_name_2;
3706 : PyObject *__pyx_n_s_ndim;
3707 : PyObject *__pyx_n_s_new;
3708 : PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
3709 : PyObject *__pyx_n_s_np;
3710 : PyObject *__pyx_n_s_numpy;
3711 : PyObject *__pyx_kp_u_numpy__core_multiarray_failed_to;
3712 : PyObject *__pyx_kp_u_numpy__core_umath_failed_to_impo;
3713 : PyObject *__pyx_n_s_obj;
3714 : PyObject *__pyx_n_s_ones;
3715 : PyObject *__pyx_n_s_p;
3716 : PyObject *__pyx_n_s_pack;
3717 : PyObject *__pyx_n_s_peak;
3718 : PyObject *__pyx_kp_u_peak_is_not_a_valid_index_for_x;
3719 : PyObject *__pyx_n_s_peak_nr;
3720 : PyObject *__pyx_n_s_peak_prominences;
3721 : PyObject *__pyx_n_u_peak_prominences;
3722 : PyObject *__pyx_n_s_peak_widths;
3723 : PyObject *__pyx_n_u_peak_widths;
3724 : PyObject *__pyx_n_s_peaks;
3725 : PyObject *__pyx_n_s_peaks_size;
3726 : PyObject *__pyx_n_s_pickle;
3727 : PyObject *__pyx_n_s_prepare;
3728 : PyObject *__pyx_n_s_priority;
3729 : PyObject *__pyx_n_s_priority_to_position;
3730 : PyObject *__pyx_kp_u_prominence_data_is_invalid_for_p;
3731 : PyObject *__pyx_n_s_prominences;
3732 : PyObject *__pyx_n_s_pyx_PickleError;
3733 : PyObject *__pyx_n_s_pyx_checksum;
3734 : PyObject *__pyx_n_s_pyx_result;
3735 : PyObject *__pyx_n_s_pyx_state;
3736 : PyObject *__pyx_n_s_pyx_type;
3737 : PyObject *__pyx_n_s_pyx_unpickle_Enum;
3738 : PyObject *__pyx_n_s_pyx_vtable;
3739 : PyObject *__pyx_n_s_qualname;
3740 : PyObject *__pyx_n_s_range;
3741 : PyObject *__pyx_n_s_reduce;
3742 : PyObject *__pyx_n_s_reduce_cython;
3743 : PyObject *__pyx_n_s_reduce_ex;
3744 : PyObject *__pyx_n_s_refcheck;
3745 : PyObject *__pyx_n_s_register;
3746 : PyObject *__pyx_n_s_rel_height;
3747 : PyObject *__pyx_kp_u_rel_height_must_be_greater_or_e;
3748 : PyObject *__pyx_n_s_resize;
3749 : PyObject *__pyx_n_s_right_bases;
3750 : PyObject *__pyx_n_s_right_edges;
3751 : PyObject *__pyx_n_s_right_ip;
3752 : PyObject *__pyx_n_s_right_ips;
3753 : PyObject *__pyx_n_s_right_min;
3754 : PyObject *__pyx_n_s_scipy_signal__peak_finding_utils;
3755 : PyObject *__pyx_n_s_select_by_peak_distance;
3756 : PyObject *__pyx_n_u_select_by_peak_distance;
3757 : PyObject *__pyx_n_s_set_name;
3758 : PyObject *__pyx_n_s_setstate;
3759 : PyObject *__pyx_n_s_setstate_cython;
3760 : PyObject *__pyx_n_s_shape;
3761 : PyObject *__pyx_n_s_show_warning;
3762 : PyObject *__pyx_n_s_size;
3763 : PyObject *__pyx_kp_u_some_peaks_have_a_prominence_of;
3764 : PyObject *__pyx_kp_u_some_peaks_have_a_width_of_0;
3765 : PyObject *__pyx_n_s_spec;
3766 : PyObject *__pyx_n_s_stacklevel;
3767 : PyObject *__pyx_n_s_start;
3768 : PyObject *__pyx_n_s_step;
3769 : PyObject *__pyx_n_s_stop;
3770 : PyObject *__pyx_kp_s_strided_and_direct;
3771 : PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
3772 : PyObject *__pyx_kp_s_strided_and_indirect;
3773 : PyObject *__pyx_kp_s_stringsource;
3774 : PyObject *__pyx_n_s_struct;
3775 : PyObject *__pyx_n_s_super;
3776 : PyObject *__pyx_n_s_sys;
3777 : PyObject *__pyx_n_s_test;
3778 : PyObject *__pyx_n_s_uint8;
3779 : PyObject *__pyx_kp_s_unable_to_allocate_array_data;
3780 : PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
3781 : PyObject *__pyx_n_s_unpack;
3782 : PyObject *__pyx_n_s_update;
3783 : PyObject *__pyx_n_s_version_info;
3784 : PyObject *__pyx_n_s_view;
3785 : PyObject *__pyx_n_s_warn;
3786 : PyObject *__pyx_n_s_warnings;
3787 : PyObject *__pyx_n_s_width_heights;
3788 : PyObject *__pyx_n_s_widths;
3789 : PyObject *__pyx_n_s_wlen;
3790 : PyObject *__pyx_n_s_x;
3791 : PyObject *__pyx_int_0;
3792 : PyObject *__pyx_int_1;
3793 : PyObject *__pyx_int_2;
3794 : PyObject *__pyx_int_3;
3795 : PyObject *__pyx_int_112105877;
3796 : PyObject *__pyx_int_136983863;
3797 : PyObject *__pyx_int_184977713;
3798 : PyObject *__pyx_int_neg_1;
3799 : PyObject *__pyx_slice__5;
3800 : PyObject *__pyx_tuple__4;
3801 : PyObject *__pyx_tuple__8;
3802 : PyObject *__pyx_tuple__9;
3803 : PyObject *__pyx_tuple__10;
3804 : PyObject *__pyx_tuple__11;
3805 : PyObject *__pyx_tuple__12;
3806 : PyObject *__pyx_tuple__13;
3807 : PyObject *__pyx_tuple__14;
3808 : PyObject *__pyx_tuple__15;
3809 : PyObject *__pyx_tuple__16;
3810 : PyObject *__pyx_tuple__17;
3811 : PyObject *__pyx_tuple__18;
3812 : PyObject *__pyx_tuple__19;
3813 : PyObject *__pyx_tuple__20;
3814 : PyObject *__pyx_tuple__21;
3815 : PyObject *__pyx_tuple__22;
3816 : PyObject *__pyx_tuple__24;
3817 : PyObject *__pyx_tuple__26;
3818 : PyObject *__pyx_tuple__28;
3819 : PyObject *__pyx_tuple__29;
3820 : PyObject *__pyx_tuple__30;
3821 : PyObject *__pyx_tuple__32;
3822 : PyObject *__pyx_codeobj__23;
3823 : PyObject *__pyx_codeobj__25;
3824 : PyObject *__pyx_codeobj__27;
3825 : PyObject *__pyx_codeobj__31;
3826 : PyObject *__pyx_codeobj__33;
3827 : } __pyx_mstate;
3828 :
3829 : #if CYTHON_USE_MODULE_STATE
3830 : #ifdef __cplusplus
3831 : namespace {
3832 : extern struct PyModuleDef __pyx_moduledef;
3833 : } /* anonymous namespace */
3834 : #else
3835 : static struct PyModuleDef __pyx_moduledef;
3836 : #endif
3837 :
3838 : #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
3839 :
3840 : #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
3841 :
3842 : #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
3843 : #else
3844 : static __pyx_mstate __pyx_mstate_global_static =
3845 : #ifdef __cplusplus
3846 : {};
3847 : #else
3848 : {0};
3849 : #endif
3850 : static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
3851 : #endif
3852 : /* #### Code section: module_state_clear ### */
3853 : #if CYTHON_USE_MODULE_STATE
3854 : static int __pyx_m_clear(PyObject *m) {
3855 : __pyx_mstate *clear_module_state = __pyx_mstate(m);
3856 : if (!clear_module_state) return 0;
3857 : Py_CLEAR(clear_module_state->__pyx_d);
3858 : Py_CLEAR(clear_module_state->__pyx_b);
3859 : Py_CLEAR(clear_module_state->__pyx_cython_runtime);
3860 : Py_CLEAR(clear_module_state->__pyx_empty_tuple);
3861 : Py_CLEAR(clear_module_state->__pyx_empty_bytes);
3862 : Py_CLEAR(clear_module_state->__pyx_empty_unicode);
3863 : #ifdef __Pyx_CyFunction_USED
3864 : Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
3865 : #endif
3866 : #ifdef __Pyx_FusedFunction_USED
3867 : Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
3868 : #endif
3869 : Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
3870 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_dtype);
3871 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flatiter);
3872 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_broadcast);
3873 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ndarray);
3874 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_generic);
3875 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_number);
3876 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_integer);
3877 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_signedinteger);
3878 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_unsignedinteger);
3879 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_inexact);
3880 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_floating);
3881 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_complexfloating);
3882 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_flexible);
3883 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_character);
3884 : Py_CLEAR(clear_module_state->__pyx_ptype_5numpy_ufunc);
3885 : Py_CLEAR(clear_module_state->__pyx_array_type);
3886 : Py_CLEAR(clear_module_state->__pyx_type___pyx_array);
3887 : Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type);
3888 : Py_CLEAR(clear_module_state->__pyx_type___pyx_MemviewEnum);
3889 : Py_CLEAR(clear_module_state->__pyx_memoryview_type);
3890 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryview);
3891 : Py_CLEAR(clear_module_state->__pyx_memoryviewslice_type);
3892 : Py_CLEAR(clear_module_state->__pyx_type___pyx_memoryviewslice);
3893 : Py_CLEAR(clear_module_state->__pyx_kp_u_);
3894 : Py_CLEAR(clear_module_state->__pyx_n_s_ASCII);
3895 : Py_CLEAR(clear_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
3896 : Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
3897 : Py_CLEAR(clear_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
3898 : Py_CLEAR(clear_module_state->__pyx_kp_s_Calculated_property_of_a_peak_ha);
3899 : Py_CLEAR(clear_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
3900 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
3901 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
3902 : Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_index_with_type);
3903 : Py_CLEAR(clear_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
3904 : Py_CLEAR(clear_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
3905 : Py_CLEAR(clear_module_state->__pyx_n_s_Ellipsis);
3906 : Py_CLEAR(clear_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
3907 : Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
3908 : Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
3909 : Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
3910 : Py_CLEAR(clear_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
3911 : Py_CLEAR(clear_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
3912 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
3913 : Py_CLEAR(clear_module_state->__pyx_kp_u_Invalid_shape_in_axis);
3914 : Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
3915 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
3916 : Py_CLEAR(clear_module_state->__pyx_kp_s_MemoryView_of_r_object);
3917 : Py_CLEAR(clear_module_state->__pyx_n_b_O);
3918 : Py_CLEAR(clear_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
3919 : Py_CLEAR(clear_module_state->__pyx_n_s_PeakPropertyWarning);
3920 : Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
3921 : Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeWarning);
3922 : Py_CLEAR(clear_module_state->__pyx_n_s_Sequence);
3923 : Py_CLEAR(clear_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
3924 : Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
3925 : Py_CLEAR(clear_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
3926 : Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
3927 : Py_CLEAR(clear_module_state->__pyx_n_s_View_MemoryView);
3928 : Py_CLEAR(clear_module_state->__pyx_kp_u__2);
3929 : Py_CLEAR(clear_module_state->__pyx_n_s__3);
3930 : Py_CLEAR(clear_module_state->__pyx_n_s__34);
3931 : Py_CLEAR(clear_module_state->__pyx_kp_u__6);
3932 : Py_CLEAR(clear_module_state->__pyx_kp_u__7);
3933 : Py_CLEAR(clear_module_state->__pyx_n_s_abc);
3934 : Py_CLEAR(clear_module_state->__pyx_n_s_all);
3935 : Py_CLEAR(clear_module_state->__pyx_n_s_allocate_buffer);
3936 : Py_CLEAR(clear_module_state->__pyx_kp_u_and);
3937 : Py_CLEAR(clear_module_state->__pyx_n_s_argsort);
3938 : Py_CLEAR(clear_module_state->__pyx_kp_u_arrays_in_prominence_data_must_h);
3939 : Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
3940 : Py_CLEAR(clear_module_state->__pyx_n_s_base);
3941 : Py_CLEAR(clear_module_state->__pyx_n_s_bool);
3942 : Py_CLEAR(clear_module_state->__pyx_n_s_c);
3943 : Py_CLEAR(clear_module_state->__pyx_n_u_c);
3944 : Py_CLEAR(clear_module_state->__pyx_n_s_class);
3945 : Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
3946 : Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
3947 : Py_CLEAR(clear_module_state->__pyx_n_s_collections);
3948 : Py_CLEAR(clear_module_state->__pyx_kp_s_collections_abc);
3949 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_direct);
3950 : Py_CLEAR(clear_module_state->__pyx_kp_s_contiguous_and_indirect);
3951 : Py_CLEAR(clear_module_state->__pyx_n_s_count);
3952 : Py_CLEAR(clear_module_state->__pyx_n_s_dict);
3953 : Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
3954 : Py_CLEAR(clear_module_state->__pyx_n_s_distance);
3955 : Py_CLEAR(clear_module_state->__pyx_n_s_distance_2);
3956 : Py_CLEAR(clear_module_state->__pyx_n_s_doc);
3957 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype);
3958 : Py_CLEAR(clear_module_state->__pyx_n_s_dtype_is_object);
3959 : Py_CLEAR(clear_module_state->__pyx_n_s_empty);
3960 : Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
3961 : Py_CLEAR(clear_module_state->__pyx_n_s_encode);
3962 : Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
3963 : Py_CLEAR(clear_module_state->__pyx_n_s_error);
3964 : Py_CLEAR(clear_module_state->__pyx_n_s_flags);
3965 : Py_CLEAR(clear_module_state->__pyx_n_s_float64);
3966 : Py_CLEAR(clear_module_state->__pyx_n_s_format);
3967 : Py_CLEAR(clear_module_state->__pyx_n_s_fortran);
3968 : Py_CLEAR(clear_module_state->__pyx_n_u_fortran);
3969 : Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
3970 : Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
3971 : Py_CLEAR(clear_module_state->__pyx_kp_u_got);
3972 : Py_CLEAR(clear_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
3973 : Py_CLEAR(clear_module_state->__pyx_n_s_height);
3974 : Py_CLEAR(clear_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
3975 : Py_CLEAR(clear_module_state->__pyx_n_s_i);
3976 : Py_CLEAR(clear_module_state->__pyx_n_s_i_ahead);
3977 : Py_CLEAR(clear_module_state->__pyx_n_s_i_max);
3978 : Py_CLEAR(clear_module_state->__pyx_n_s_i_min);
3979 : Py_CLEAR(clear_module_state->__pyx_n_s_id);
3980 : Py_CLEAR(clear_module_state->__pyx_n_s_import);
3981 : Py_CLEAR(clear_module_state->__pyx_n_s_index);
3982 : Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
3983 : Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
3984 : Py_CLEAR(clear_module_state->__pyx_n_s_intp);
3985 : Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
3986 : Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
3987 : Py_CLEAR(clear_module_state->__pyx_n_s_itemsize);
3988 : Py_CLEAR(clear_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
3989 : Py_CLEAR(clear_module_state->__pyx_n_s_j);
3990 : Py_CLEAR(clear_module_state->__pyx_n_s_k);
3991 : Py_CLEAR(clear_module_state->__pyx_n_s_keep);
3992 : Py_CLEAR(clear_module_state->__pyx_n_s_left_bases);
3993 : Py_CLEAR(clear_module_state->__pyx_n_s_left_edges);
3994 : Py_CLEAR(clear_module_state->__pyx_n_s_left_ip);
3995 : Py_CLEAR(clear_module_state->__pyx_n_s_left_ips);
3996 : Py_CLEAR(clear_module_state->__pyx_n_s_left_min);
3997 : Py_CLEAR(clear_module_state->__pyx_n_s_local_maxima_1d);
3998 : Py_CLEAR(clear_module_state->__pyx_n_u_local_maxima_1d);
3999 : Py_CLEAR(clear_module_state->__pyx_n_s_m);
4000 : Py_CLEAR(clear_module_state->__pyx_n_s_main);
4001 : Py_CLEAR(clear_module_state->__pyx_n_s_memview);
4002 : Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
4003 : Py_CLEAR(clear_module_state->__pyx_n_s_midpoints);
4004 : Py_CLEAR(clear_module_state->__pyx_n_s_mode);
4005 : Py_CLEAR(clear_module_state->__pyx_n_s_module);
4006 : Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
4007 : Py_CLEAR(clear_module_state->__pyx_n_s_name);
4008 : Py_CLEAR(clear_module_state->__pyx_n_s_name_2);
4009 : Py_CLEAR(clear_module_state->__pyx_n_s_ndim);
4010 : Py_CLEAR(clear_module_state->__pyx_n_s_new);
4011 : Py_CLEAR(clear_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4012 : Py_CLEAR(clear_module_state->__pyx_n_s_np);
4013 : Py_CLEAR(clear_module_state->__pyx_n_s_numpy);
4014 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4015 : Py_CLEAR(clear_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4016 : Py_CLEAR(clear_module_state->__pyx_n_s_obj);
4017 : Py_CLEAR(clear_module_state->__pyx_n_s_ones);
4018 : Py_CLEAR(clear_module_state->__pyx_n_s_p);
4019 : Py_CLEAR(clear_module_state->__pyx_n_s_pack);
4020 : Py_CLEAR(clear_module_state->__pyx_n_s_peak);
4021 : Py_CLEAR(clear_module_state->__pyx_kp_u_peak_is_not_a_valid_index_for_x);
4022 : Py_CLEAR(clear_module_state->__pyx_n_s_peak_nr);
4023 : Py_CLEAR(clear_module_state->__pyx_n_s_peak_prominences);
4024 : Py_CLEAR(clear_module_state->__pyx_n_u_peak_prominences);
4025 : Py_CLEAR(clear_module_state->__pyx_n_s_peak_widths);
4026 : Py_CLEAR(clear_module_state->__pyx_n_u_peak_widths);
4027 : Py_CLEAR(clear_module_state->__pyx_n_s_peaks);
4028 : Py_CLEAR(clear_module_state->__pyx_n_s_peaks_size);
4029 : Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
4030 : Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
4031 : Py_CLEAR(clear_module_state->__pyx_n_s_priority);
4032 : Py_CLEAR(clear_module_state->__pyx_n_s_priority_to_position);
4033 : Py_CLEAR(clear_module_state->__pyx_kp_u_prominence_data_is_invalid_for_p);
4034 : Py_CLEAR(clear_module_state->__pyx_n_s_prominences);
4035 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
4036 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
4037 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
4038 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
4039 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
4040 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_Enum);
4041 : Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
4042 : Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
4043 : Py_CLEAR(clear_module_state->__pyx_n_s_range);
4044 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
4045 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
4046 : Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
4047 : Py_CLEAR(clear_module_state->__pyx_n_s_refcheck);
4048 : Py_CLEAR(clear_module_state->__pyx_n_s_register);
4049 : Py_CLEAR(clear_module_state->__pyx_n_s_rel_height);
4050 : Py_CLEAR(clear_module_state->__pyx_kp_u_rel_height_must_be_greater_or_e);
4051 : Py_CLEAR(clear_module_state->__pyx_n_s_resize);
4052 : Py_CLEAR(clear_module_state->__pyx_n_s_right_bases);
4053 : Py_CLEAR(clear_module_state->__pyx_n_s_right_edges);
4054 : Py_CLEAR(clear_module_state->__pyx_n_s_right_ip);
4055 : Py_CLEAR(clear_module_state->__pyx_n_s_right_ips);
4056 : Py_CLEAR(clear_module_state->__pyx_n_s_right_min);
4057 : Py_CLEAR(clear_module_state->__pyx_n_s_scipy_signal__peak_finding_utils);
4058 : Py_CLEAR(clear_module_state->__pyx_n_s_select_by_peak_distance);
4059 : Py_CLEAR(clear_module_state->__pyx_n_u_select_by_peak_distance);
4060 : Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
4061 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
4062 : Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
4063 : Py_CLEAR(clear_module_state->__pyx_n_s_shape);
4064 : Py_CLEAR(clear_module_state->__pyx_n_s_show_warning);
4065 : Py_CLEAR(clear_module_state->__pyx_n_s_size);
4066 : Py_CLEAR(clear_module_state->__pyx_kp_u_some_peaks_have_a_prominence_of);
4067 : Py_CLEAR(clear_module_state->__pyx_kp_u_some_peaks_have_a_width_of_0);
4068 : Py_CLEAR(clear_module_state->__pyx_n_s_spec);
4069 : Py_CLEAR(clear_module_state->__pyx_n_s_stacklevel);
4070 : Py_CLEAR(clear_module_state->__pyx_n_s_start);
4071 : Py_CLEAR(clear_module_state->__pyx_n_s_step);
4072 : Py_CLEAR(clear_module_state->__pyx_n_s_stop);
4073 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct);
4074 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4075 : Py_CLEAR(clear_module_state->__pyx_kp_s_strided_and_indirect);
4076 : Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
4077 : Py_CLEAR(clear_module_state->__pyx_n_s_struct);
4078 : Py_CLEAR(clear_module_state->__pyx_n_s_super);
4079 : Py_CLEAR(clear_module_state->__pyx_n_s_sys);
4080 : Py_CLEAR(clear_module_state->__pyx_n_s_test);
4081 : Py_CLEAR(clear_module_state->__pyx_n_s_uint8);
4082 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4083 : Py_CLEAR(clear_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4084 : Py_CLEAR(clear_module_state->__pyx_n_s_unpack);
4085 : Py_CLEAR(clear_module_state->__pyx_n_s_update);
4086 : Py_CLEAR(clear_module_state->__pyx_n_s_version_info);
4087 : Py_CLEAR(clear_module_state->__pyx_n_s_view);
4088 : Py_CLEAR(clear_module_state->__pyx_n_s_warn);
4089 : Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
4090 : Py_CLEAR(clear_module_state->__pyx_n_s_width_heights);
4091 : Py_CLEAR(clear_module_state->__pyx_n_s_widths);
4092 : Py_CLEAR(clear_module_state->__pyx_n_s_wlen);
4093 : Py_CLEAR(clear_module_state->__pyx_n_s_x);
4094 : Py_CLEAR(clear_module_state->__pyx_int_0);
4095 : Py_CLEAR(clear_module_state->__pyx_int_1);
4096 : Py_CLEAR(clear_module_state->__pyx_int_2);
4097 : Py_CLEAR(clear_module_state->__pyx_int_3);
4098 : Py_CLEAR(clear_module_state->__pyx_int_112105877);
4099 : Py_CLEAR(clear_module_state->__pyx_int_136983863);
4100 : Py_CLEAR(clear_module_state->__pyx_int_184977713);
4101 : Py_CLEAR(clear_module_state->__pyx_int_neg_1);
4102 : Py_CLEAR(clear_module_state->__pyx_slice__5);
4103 : Py_CLEAR(clear_module_state->__pyx_tuple__4);
4104 : Py_CLEAR(clear_module_state->__pyx_tuple__8);
4105 : Py_CLEAR(clear_module_state->__pyx_tuple__9);
4106 : Py_CLEAR(clear_module_state->__pyx_tuple__10);
4107 : Py_CLEAR(clear_module_state->__pyx_tuple__11);
4108 : Py_CLEAR(clear_module_state->__pyx_tuple__12);
4109 : Py_CLEAR(clear_module_state->__pyx_tuple__13);
4110 : Py_CLEAR(clear_module_state->__pyx_tuple__14);
4111 : Py_CLEAR(clear_module_state->__pyx_tuple__15);
4112 : Py_CLEAR(clear_module_state->__pyx_tuple__16);
4113 : Py_CLEAR(clear_module_state->__pyx_tuple__17);
4114 : Py_CLEAR(clear_module_state->__pyx_tuple__18);
4115 : Py_CLEAR(clear_module_state->__pyx_tuple__19);
4116 : Py_CLEAR(clear_module_state->__pyx_tuple__20);
4117 : Py_CLEAR(clear_module_state->__pyx_tuple__21);
4118 : Py_CLEAR(clear_module_state->__pyx_tuple__22);
4119 : Py_CLEAR(clear_module_state->__pyx_tuple__24);
4120 : Py_CLEAR(clear_module_state->__pyx_tuple__26);
4121 : Py_CLEAR(clear_module_state->__pyx_tuple__28);
4122 : Py_CLEAR(clear_module_state->__pyx_tuple__29);
4123 : Py_CLEAR(clear_module_state->__pyx_tuple__30);
4124 : Py_CLEAR(clear_module_state->__pyx_tuple__32);
4125 : Py_CLEAR(clear_module_state->__pyx_codeobj__23);
4126 : Py_CLEAR(clear_module_state->__pyx_codeobj__25);
4127 : Py_CLEAR(clear_module_state->__pyx_codeobj__27);
4128 : Py_CLEAR(clear_module_state->__pyx_codeobj__31);
4129 : Py_CLEAR(clear_module_state->__pyx_codeobj__33);
4130 : return 0;
4131 : }
4132 : #endif
4133 : /* #### Code section: module_state_traverse ### */
4134 : #if CYTHON_USE_MODULE_STATE
4135 : static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4136 : __pyx_mstate *traverse_module_state = __pyx_mstate(m);
4137 : if (!traverse_module_state) return 0;
4138 : Py_VISIT(traverse_module_state->__pyx_d);
4139 : Py_VISIT(traverse_module_state->__pyx_b);
4140 : Py_VISIT(traverse_module_state->__pyx_cython_runtime);
4141 : Py_VISIT(traverse_module_state->__pyx_empty_tuple);
4142 : Py_VISIT(traverse_module_state->__pyx_empty_bytes);
4143 : Py_VISIT(traverse_module_state->__pyx_empty_unicode);
4144 : #ifdef __Pyx_CyFunction_USED
4145 : Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
4146 : #endif
4147 : #ifdef __Pyx_FusedFunction_USED
4148 : Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
4149 : #endif
4150 : Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
4151 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_dtype);
4152 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flatiter);
4153 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_broadcast);
4154 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ndarray);
4155 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_generic);
4156 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_number);
4157 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_integer);
4158 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_signedinteger);
4159 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_unsignedinteger);
4160 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_inexact);
4161 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_floating);
4162 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_complexfloating);
4163 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_flexible);
4164 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_character);
4165 : Py_VISIT(traverse_module_state->__pyx_ptype_5numpy_ufunc);
4166 : Py_VISIT(traverse_module_state->__pyx_array_type);
4167 : Py_VISIT(traverse_module_state->__pyx_type___pyx_array);
4168 : Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type);
4169 : Py_VISIT(traverse_module_state->__pyx_type___pyx_MemviewEnum);
4170 : Py_VISIT(traverse_module_state->__pyx_memoryview_type);
4171 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryview);
4172 : Py_VISIT(traverse_module_state->__pyx_memoryviewslice_type);
4173 : Py_VISIT(traverse_module_state->__pyx_type___pyx_memoryviewslice);
4174 : Py_VISIT(traverse_module_state->__pyx_kp_u_);
4175 : Py_VISIT(traverse_module_state->__pyx_n_s_ASCII);
4176 : Py_VISIT(traverse_module_state->__pyx_kp_s_All_dimensions_preceding_dimensi);
4177 : Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
4178 : Py_VISIT(traverse_module_state->__pyx_kp_s_Buffer_view_does_not_expose_stri);
4179 : Py_VISIT(traverse_module_state->__pyx_kp_s_Calculated_property_of_a_peak_ha);
4180 : Py_VISIT(traverse_module_state->__pyx_kp_s_Can_only_create_a_buffer_that_is);
4181 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_assign_to_read_only_memor);
4182 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_create_writable_memory_vi);
4183 : Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_index_with_type);
4184 : Py_VISIT(traverse_module_state->__pyx_kp_s_Cannot_transpose_memoryview_with);
4185 : Py_VISIT(traverse_module_state->__pyx_kp_s_Dimension_d_is_not_direct);
4186 : Py_VISIT(traverse_module_state->__pyx_n_s_Ellipsis);
4187 : Py_VISIT(traverse_module_state->__pyx_kp_s_Empty_shape_tuple_for_cython_arr);
4188 : Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
4189 : Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0);
4190 : Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
4191 : Py_VISIT(traverse_module_state->__pyx_kp_s_Index_out_of_bounds_axis_d);
4192 : Py_VISIT(traverse_module_state->__pyx_kp_s_Indirect_dimensions_not_supporte);
4193 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_mode_expected_c_or_fortr);
4194 : Py_VISIT(traverse_module_state->__pyx_kp_u_Invalid_shape_in_axis);
4195 : Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
4196 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_at_0x_x);
4197 : Py_VISIT(traverse_module_state->__pyx_kp_s_MemoryView_of_r_object);
4198 : Py_VISIT(traverse_module_state->__pyx_n_b_O);
4199 : Py_VISIT(traverse_module_state->__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
4200 : Py_VISIT(traverse_module_state->__pyx_n_s_PeakPropertyWarning);
4201 : Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
4202 : Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeWarning);
4203 : Py_VISIT(traverse_module_state->__pyx_n_s_Sequence);
4204 : Py_VISIT(traverse_module_state->__pyx_kp_s_Step_may_not_be_zero_axis_d);
4205 : Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
4206 : Py_VISIT(traverse_module_state->__pyx_kp_s_Unable_to_convert_item_to_object);
4207 : Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
4208 : Py_VISIT(traverse_module_state->__pyx_n_s_View_MemoryView);
4209 : Py_VISIT(traverse_module_state->__pyx_kp_u__2);
4210 : Py_VISIT(traverse_module_state->__pyx_n_s__3);
4211 : Py_VISIT(traverse_module_state->__pyx_n_s__34);
4212 : Py_VISIT(traverse_module_state->__pyx_kp_u__6);
4213 : Py_VISIT(traverse_module_state->__pyx_kp_u__7);
4214 : Py_VISIT(traverse_module_state->__pyx_n_s_abc);
4215 : Py_VISIT(traverse_module_state->__pyx_n_s_all);
4216 : Py_VISIT(traverse_module_state->__pyx_n_s_allocate_buffer);
4217 : Py_VISIT(traverse_module_state->__pyx_kp_u_and);
4218 : Py_VISIT(traverse_module_state->__pyx_n_s_argsort);
4219 : Py_VISIT(traverse_module_state->__pyx_kp_u_arrays_in_prominence_data_must_h);
4220 : Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
4221 : Py_VISIT(traverse_module_state->__pyx_n_s_base);
4222 : Py_VISIT(traverse_module_state->__pyx_n_s_bool);
4223 : Py_VISIT(traverse_module_state->__pyx_n_s_c);
4224 : Py_VISIT(traverse_module_state->__pyx_n_u_c);
4225 : Py_VISIT(traverse_module_state->__pyx_n_s_class);
4226 : Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
4227 : Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
4228 : Py_VISIT(traverse_module_state->__pyx_n_s_collections);
4229 : Py_VISIT(traverse_module_state->__pyx_kp_s_collections_abc);
4230 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_direct);
4231 : Py_VISIT(traverse_module_state->__pyx_kp_s_contiguous_and_indirect);
4232 : Py_VISIT(traverse_module_state->__pyx_n_s_count);
4233 : Py_VISIT(traverse_module_state->__pyx_n_s_dict);
4234 : Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
4235 : Py_VISIT(traverse_module_state->__pyx_n_s_distance);
4236 : Py_VISIT(traverse_module_state->__pyx_n_s_distance_2);
4237 : Py_VISIT(traverse_module_state->__pyx_n_s_doc);
4238 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype);
4239 : Py_VISIT(traverse_module_state->__pyx_n_s_dtype_is_object);
4240 : Py_VISIT(traverse_module_state->__pyx_n_s_empty);
4241 : Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
4242 : Py_VISIT(traverse_module_state->__pyx_n_s_encode);
4243 : Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
4244 : Py_VISIT(traverse_module_state->__pyx_n_s_error);
4245 : Py_VISIT(traverse_module_state->__pyx_n_s_flags);
4246 : Py_VISIT(traverse_module_state->__pyx_n_s_float64);
4247 : Py_VISIT(traverse_module_state->__pyx_n_s_format);
4248 : Py_VISIT(traverse_module_state->__pyx_n_s_fortran);
4249 : Py_VISIT(traverse_module_state->__pyx_n_u_fortran);
4250 : Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
4251 : Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
4252 : Py_VISIT(traverse_module_state->__pyx_kp_u_got);
4253 : Py_VISIT(traverse_module_state->__pyx_kp_u_got_differing_extents_in_dimensi);
4254 : Py_VISIT(traverse_module_state->__pyx_n_s_height);
4255 : Py_VISIT(traverse_module_state->__pyx_kp_s_home_czgdp18079_Quansight_scipy);
4256 : Py_VISIT(traverse_module_state->__pyx_n_s_i);
4257 : Py_VISIT(traverse_module_state->__pyx_n_s_i_ahead);
4258 : Py_VISIT(traverse_module_state->__pyx_n_s_i_max);
4259 : Py_VISIT(traverse_module_state->__pyx_n_s_i_min);
4260 : Py_VISIT(traverse_module_state->__pyx_n_s_id);
4261 : Py_VISIT(traverse_module_state->__pyx_n_s_import);
4262 : Py_VISIT(traverse_module_state->__pyx_n_s_index);
4263 : Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
4264 : Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
4265 : Py_VISIT(traverse_module_state->__pyx_n_s_intp);
4266 : Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
4267 : Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
4268 : Py_VISIT(traverse_module_state->__pyx_n_s_itemsize);
4269 : Py_VISIT(traverse_module_state->__pyx_kp_s_itemsize_0_for_cython_array);
4270 : Py_VISIT(traverse_module_state->__pyx_n_s_j);
4271 : Py_VISIT(traverse_module_state->__pyx_n_s_k);
4272 : Py_VISIT(traverse_module_state->__pyx_n_s_keep);
4273 : Py_VISIT(traverse_module_state->__pyx_n_s_left_bases);
4274 : Py_VISIT(traverse_module_state->__pyx_n_s_left_edges);
4275 : Py_VISIT(traverse_module_state->__pyx_n_s_left_ip);
4276 : Py_VISIT(traverse_module_state->__pyx_n_s_left_ips);
4277 : Py_VISIT(traverse_module_state->__pyx_n_s_left_min);
4278 : Py_VISIT(traverse_module_state->__pyx_n_s_local_maxima_1d);
4279 : Py_VISIT(traverse_module_state->__pyx_n_u_local_maxima_1d);
4280 : Py_VISIT(traverse_module_state->__pyx_n_s_m);
4281 : Py_VISIT(traverse_module_state->__pyx_n_s_main);
4282 : Py_VISIT(traverse_module_state->__pyx_n_s_memview);
4283 : Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
4284 : Py_VISIT(traverse_module_state->__pyx_n_s_midpoints);
4285 : Py_VISIT(traverse_module_state->__pyx_n_s_mode);
4286 : Py_VISIT(traverse_module_state->__pyx_n_s_module);
4287 : Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
4288 : Py_VISIT(traverse_module_state->__pyx_n_s_name);
4289 : Py_VISIT(traverse_module_state->__pyx_n_s_name_2);
4290 : Py_VISIT(traverse_module_state->__pyx_n_s_ndim);
4291 : Py_VISIT(traverse_module_state->__pyx_n_s_new);
4292 : Py_VISIT(traverse_module_state->__pyx_kp_s_no_default___reduce___due_to_non);
4293 : Py_VISIT(traverse_module_state->__pyx_n_s_np);
4294 : Py_VISIT(traverse_module_state->__pyx_n_s_numpy);
4295 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_multiarray_failed_to);
4296 : Py_VISIT(traverse_module_state->__pyx_kp_u_numpy__core_umath_failed_to_impo);
4297 : Py_VISIT(traverse_module_state->__pyx_n_s_obj);
4298 : Py_VISIT(traverse_module_state->__pyx_n_s_ones);
4299 : Py_VISIT(traverse_module_state->__pyx_n_s_p);
4300 : Py_VISIT(traverse_module_state->__pyx_n_s_pack);
4301 : Py_VISIT(traverse_module_state->__pyx_n_s_peak);
4302 : Py_VISIT(traverse_module_state->__pyx_kp_u_peak_is_not_a_valid_index_for_x);
4303 : Py_VISIT(traverse_module_state->__pyx_n_s_peak_nr);
4304 : Py_VISIT(traverse_module_state->__pyx_n_s_peak_prominences);
4305 : Py_VISIT(traverse_module_state->__pyx_n_u_peak_prominences);
4306 : Py_VISIT(traverse_module_state->__pyx_n_s_peak_widths);
4307 : Py_VISIT(traverse_module_state->__pyx_n_u_peak_widths);
4308 : Py_VISIT(traverse_module_state->__pyx_n_s_peaks);
4309 : Py_VISIT(traverse_module_state->__pyx_n_s_peaks_size);
4310 : Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
4311 : Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
4312 : Py_VISIT(traverse_module_state->__pyx_n_s_priority);
4313 : Py_VISIT(traverse_module_state->__pyx_n_s_priority_to_position);
4314 : Py_VISIT(traverse_module_state->__pyx_kp_u_prominence_data_is_invalid_for_p);
4315 : Py_VISIT(traverse_module_state->__pyx_n_s_prominences);
4316 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
4317 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
4318 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
4319 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
4320 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
4321 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_Enum);
4322 : Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
4323 : Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
4324 : Py_VISIT(traverse_module_state->__pyx_n_s_range);
4325 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
4326 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
4327 : Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
4328 : Py_VISIT(traverse_module_state->__pyx_n_s_refcheck);
4329 : Py_VISIT(traverse_module_state->__pyx_n_s_register);
4330 : Py_VISIT(traverse_module_state->__pyx_n_s_rel_height);
4331 : Py_VISIT(traverse_module_state->__pyx_kp_u_rel_height_must_be_greater_or_e);
4332 : Py_VISIT(traverse_module_state->__pyx_n_s_resize);
4333 : Py_VISIT(traverse_module_state->__pyx_n_s_right_bases);
4334 : Py_VISIT(traverse_module_state->__pyx_n_s_right_edges);
4335 : Py_VISIT(traverse_module_state->__pyx_n_s_right_ip);
4336 : Py_VISIT(traverse_module_state->__pyx_n_s_right_ips);
4337 : Py_VISIT(traverse_module_state->__pyx_n_s_right_min);
4338 : Py_VISIT(traverse_module_state->__pyx_n_s_scipy_signal__peak_finding_utils);
4339 : Py_VISIT(traverse_module_state->__pyx_n_s_select_by_peak_distance);
4340 : Py_VISIT(traverse_module_state->__pyx_n_u_select_by_peak_distance);
4341 : Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
4342 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
4343 : Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
4344 : Py_VISIT(traverse_module_state->__pyx_n_s_shape);
4345 : Py_VISIT(traverse_module_state->__pyx_n_s_show_warning);
4346 : Py_VISIT(traverse_module_state->__pyx_n_s_size);
4347 : Py_VISIT(traverse_module_state->__pyx_kp_u_some_peaks_have_a_prominence_of);
4348 : Py_VISIT(traverse_module_state->__pyx_kp_u_some_peaks_have_a_width_of_0);
4349 : Py_VISIT(traverse_module_state->__pyx_n_s_spec);
4350 : Py_VISIT(traverse_module_state->__pyx_n_s_stacklevel);
4351 : Py_VISIT(traverse_module_state->__pyx_n_s_start);
4352 : Py_VISIT(traverse_module_state->__pyx_n_s_step);
4353 : Py_VISIT(traverse_module_state->__pyx_n_s_stop);
4354 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct);
4355 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_direct_or_indirect);
4356 : Py_VISIT(traverse_module_state->__pyx_kp_s_strided_and_indirect);
4357 : Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
4358 : Py_VISIT(traverse_module_state->__pyx_n_s_struct);
4359 : Py_VISIT(traverse_module_state->__pyx_n_s_super);
4360 : Py_VISIT(traverse_module_state->__pyx_n_s_sys);
4361 : Py_VISIT(traverse_module_state->__pyx_n_s_test);
4362 : Py_VISIT(traverse_module_state->__pyx_n_s_uint8);
4363 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_array_data);
4364 : Py_VISIT(traverse_module_state->__pyx_kp_s_unable_to_allocate_shape_and_str);
4365 : Py_VISIT(traverse_module_state->__pyx_n_s_unpack);
4366 : Py_VISIT(traverse_module_state->__pyx_n_s_update);
4367 : Py_VISIT(traverse_module_state->__pyx_n_s_version_info);
4368 : Py_VISIT(traverse_module_state->__pyx_n_s_view);
4369 : Py_VISIT(traverse_module_state->__pyx_n_s_warn);
4370 : Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
4371 : Py_VISIT(traverse_module_state->__pyx_n_s_width_heights);
4372 : Py_VISIT(traverse_module_state->__pyx_n_s_widths);
4373 : Py_VISIT(traverse_module_state->__pyx_n_s_wlen);
4374 : Py_VISIT(traverse_module_state->__pyx_n_s_x);
4375 : Py_VISIT(traverse_module_state->__pyx_int_0);
4376 : Py_VISIT(traverse_module_state->__pyx_int_1);
4377 : Py_VISIT(traverse_module_state->__pyx_int_2);
4378 : Py_VISIT(traverse_module_state->__pyx_int_3);
4379 : Py_VISIT(traverse_module_state->__pyx_int_112105877);
4380 : Py_VISIT(traverse_module_state->__pyx_int_136983863);
4381 : Py_VISIT(traverse_module_state->__pyx_int_184977713);
4382 : Py_VISIT(traverse_module_state->__pyx_int_neg_1);
4383 : Py_VISIT(traverse_module_state->__pyx_slice__5);
4384 : Py_VISIT(traverse_module_state->__pyx_tuple__4);
4385 : Py_VISIT(traverse_module_state->__pyx_tuple__8);
4386 : Py_VISIT(traverse_module_state->__pyx_tuple__9);
4387 : Py_VISIT(traverse_module_state->__pyx_tuple__10);
4388 : Py_VISIT(traverse_module_state->__pyx_tuple__11);
4389 : Py_VISIT(traverse_module_state->__pyx_tuple__12);
4390 : Py_VISIT(traverse_module_state->__pyx_tuple__13);
4391 : Py_VISIT(traverse_module_state->__pyx_tuple__14);
4392 : Py_VISIT(traverse_module_state->__pyx_tuple__15);
4393 : Py_VISIT(traverse_module_state->__pyx_tuple__16);
4394 : Py_VISIT(traverse_module_state->__pyx_tuple__17);
4395 : Py_VISIT(traverse_module_state->__pyx_tuple__18);
4396 : Py_VISIT(traverse_module_state->__pyx_tuple__19);
4397 : Py_VISIT(traverse_module_state->__pyx_tuple__20);
4398 : Py_VISIT(traverse_module_state->__pyx_tuple__21);
4399 : Py_VISIT(traverse_module_state->__pyx_tuple__22);
4400 : Py_VISIT(traverse_module_state->__pyx_tuple__24);
4401 : Py_VISIT(traverse_module_state->__pyx_tuple__26);
4402 : Py_VISIT(traverse_module_state->__pyx_tuple__28);
4403 : Py_VISIT(traverse_module_state->__pyx_tuple__29);
4404 : Py_VISIT(traverse_module_state->__pyx_tuple__30);
4405 : Py_VISIT(traverse_module_state->__pyx_tuple__32);
4406 : Py_VISIT(traverse_module_state->__pyx_codeobj__23);
4407 : Py_VISIT(traverse_module_state->__pyx_codeobj__25);
4408 : Py_VISIT(traverse_module_state->__pyx_codeobj__27);
4409 : Py_VISIT(traverse_module_state->__pyx_codeobj__31);
4410 : Py_VISIT(traverse_module_state->__pyx_codeobj__33);
4411 : return 0;
4412 : }
4413 : #endif
4414 : /* #### Code section: module_state_defines ### */
4415 : #define __pyx_d __pyx_mstate_global->__pyx_d
4416 : #define __pyx_b __pyx_mstate_global->__pyx_b
4417 : #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
4418 : #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
4419 : #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
4420 : #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
4421 : #ifdef __Pyx_CyFunction_USED
4422 : #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
4423 : #endif
4424 : #ifdef __Pyx_FusedFunction_USED
4425 : #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
4426 : #endif
4427 : #ifdef __Pyx_Generator_USED
4428 : #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
4429 : #endif
4430 : #ifdef __Pyx_IterableCoroutine_USED
4431 : #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
4432 : #endif
4433 : #ifdef __Pyx_Coroutine_USED
4434 : #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
4435 : #endif
4436 : #ifdef __Pyx_Coroutine_USED
4437 : #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
4438 : #endif
4439 : #if CYTHON_USE_MODULE_STATE
4440 : #endif
4441 : #if CYTHON_USE_MODULE_STATE
4442 : #endif
4443 : #if CYTHON_USE_MODULE_STATE
4444 : #endif
4445 : #if CYTHON_USE_MODULE_STATE
4446 : #endif
4447 : #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
4448 : #if CYTHON_USE_MODULE_STATE
4449 : #endif
4450 : #if CYTHON_USE_MODULE_STATE
4451 : #endif
4452 : #if CYTHON_USE_MODULE_STATE
4453 : #endif
4454 : #if CYTHON_USE_MODULE_STATE
4455 : #endif
4456 : #if CYTHON_USE_MODULE_STATE
4457 : #endif
4458 : #define __pyx_ptype_5numpy_dtype __pyx_mstate_global->__pyx_ptype_5numpy_dtype
4459 : #define __pyx_ptype_5numpy_flatiter __pyx_mstate_global->__pyx_ptype_5numpy_flatiter
4460 : #define __pyx_ptype_5numpy_broadcast __pyx_mstate_global->__pyx_ptype_5numpy_broadcast
4461 : #define __pyx_ptype_5numpy_ndarray __pyx_mstate_global->__pyx_ptype_5numpy_ndarray
4462 : #define __pyx_ptype_5numpy_generic __pyx_mstate_global->__pyx_ptype_5numpy_generic
4463 : #define __pyx_ptype_5numpy_number __pyx_mstate_global->__pyx_ptype_5numpy_number
4464 : #define __pyx_ptype_5numpy_integer __pyx_mstate_global->__pyx_ptype_5numpy_integer
4465 : #define __pyx_ptype_5numpy_signedinteger __pyx_mstate_global->__pyx_ptype_5numpy_signedinteger
4466 : #define __pyx_ptype_5numpy_unsignedinteger __pyx_mstate_global->__pyx_ptype_5numpy_unsignedinteger
4467 : #define __pyx_ptype_5numpy_inexact __pyx_mstate_global->__pyx_ptype_5numpy_inexact
4468 : #define __pyx_ptype_5numpy_floating __pyx_mstate_global->__pyx_ptype_5numpy_floating
4469 : #define __pyx_ptype_5numpy_complexfloating __pyx_mstate_global->__pyx_ptype_5numpy_complexfloating
4470 : #define __pyx_ptype_5numpy_flexible __pyx_mstate_global->__pyx_ptype_5numpy_flexible
4471 : #define __pyx_ptype_5numpy_character __pyx_mstate_global->__pyx_ptype_5numpy_character
4472 : #define __pyx_ptype_5numpy_ufunc __pyx_mstate_global->__pyx_ptype_5numpy_ufunc
4473 : #if CYTHON_USE_MODULE_STATE
4474 : #endif
4475 : #if CYTHON_USE_MODULE_STATE
4476 : #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array
4477 : #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum
4478 : #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview
4479 : #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice
4480 : #endif
4481 : #define __pyx_array_type __pyx_mstate_global->__pyx_array_type
4482 : #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type
4483 : #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type
4484 : #define __pyx_memoryviewslice_type __pyx_mstate_global->__pyx_memoryviewslice_type
4485 : #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
4486 : #define __pyx_n_s_ASCII __pyx_mstate_global->__pyx_n_s_ASCII
4487 : #define __pyx_kp_s_All_dimensions_preceding_dimensi __pyx_mstate_global->__pyx_kp_s_All_dimensions_preceding_dimensi
4488 : #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
4489 : #define __pyx_kp_s_Buffer_view_does_not_expose_stri __pyx_mstate_global->__pyx_kp_s_Buffer_view_does_not_expose_stri
4490 : #define __pyx_kp_s_Calculated_property_of_a_peak_ha __pyx_mstate_global->__pyx_kp_s_Calculated_property_of_a_peak_ha
4491 : #define __pyx_kp_s_Can_only_create_a_buffer_that_is __pyx_mstate_global->__pyx_kp_s_Can_only_create_a_buffer_that_is
4492 : #define __pyx_kp_s_Cannot_assign_to_read_only_memor __pyx_mstate_global->__pyx_kp_s_Cannot_assign_to_read_only_memor
4493 : #define __pyx_kp_s_Cannot_create_writable_memory_vi __pyx_mstate_global->__pyx_kp_s_Cannot_create_writable_memory_vi
4494 : #define __pyx_kp_u_Cannot_index_with_type __pyx_mstate_global->__pyx_kp_u_Cannot_index_with_type
4495 : #define __pyx_kp_s_Cannot_transpose_memoryview_with __pyx_mstate_global->__pyx_kp_s_Cannot_transpose_memoryview_with
4496 : #define __pyx_kp_s_Dimension_d_is_not_direct __pyx_mstate_global->__pyx_kp_s_Dimension_d_is_not_direct
4497 : #define __pyx_n_s_Ellipsis __pyx_mstate_global->__pyx_n_s_Ellipsis
4498 : #define __pyx_kp_s_Empty_shape_tuple_for_cython_arr __pyx_mstate_global->__pyx_kp_s_Empty_shape_tuple_for_cython_arr
4499 : #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
4500 : #define __pyx_kp_s_Incompatible_checksums_0x_x_vs_0 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_0x_x_vs_0
4501 : #define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
4502 : #define __pyx_kp_s_Index_out_of_bounds_axis_d __pyx_mstate_global->__pyx_kp_s_Index_out_of_bounds_axis_d
4503 : #define __pyx_kp_s_Indirect_dimensions_not_supporte __pyx_mstate_global->__pyx_kp_s_Indirect_dimensions_not_supporte
4504 : #define __pyx_kp_u_Invalid_mode_expected_c_or_fortr __pyx_mstate_global->__pyx_kp_u_Invalid_mode_expected_c_or_fortr
4505 : #define __pyx_kp_u_Invalid_shape_in_axis __pyx_mstate_global->__pyx_kp_u_Invalid_shape_in_axis
4506 : #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
4507 : #define __pyx_kp_s_MemoryView_of_r_at_0x_x __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_at_0x_x
4508 : #define __pyx_kp_s_MemoryView_of_r_object __pyx_mstate_global->__pyx_kp_s_MemoryView_of_r_object
4509 : #define __pyx_n_b_O __pyx_mstate_global->__pyx_n_b_O
4510 : #define __pyx_kp_u_Out_of_bounds_on_buffer_access_a __pyx_mstate_global->__pyx_kp_u_Out_of_bounds_on_buffer_access_a
4511 : #define __pyx_n_s_PeakPropertyWarning __pyx_mstate_global->__pyx_n_s_PeakPropertyWarning
4512 : #define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
4513 : #define __pyx_n_s_RuntimeWarning __pyx_mstate_global->__pyx_n_s_RuntimeWarning
4514 : #define __pyx_n_s_Sequence __pyx_mstate_global->__pyx_n_s_Sequence
4515 : #define __pyx_kp_s_Step_may_not_be_zero_axis_d __pyx_mstate_global->__pyx_kp_s_Step_may_not_be_zero_axis_d
4516 : #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
4517 : #define __pyx_kp_s_Unable_to_convert_item_to_object __pyx_mstate_global->__pyx_kp_s_Unable_to_convert_item_to_object
4518 : #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
4519 : #define __pyx_n_s_View_MemoryView __pyx_mstate_global->__pyx_n_s_View_MemoryView
4520 : #define __pyx_kp_u__2 __pyx_mstate_global->__pyx_kp_u__2
4521 : #define __pyx_n_s__3 __pyx_mstate_global->__pyx_n_s__3
4522 : #define __pyx_n_s__34 __pyx_mstate_global->__pyx_n_s__34
4523 : #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6
4524 : #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
4525 : #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
4526 : #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
4527 : #define __pyx_n_s_allocate_buffer __pyx_mstate_global->__pyx_n_s_allocate_buffer
4528 : #define __pyx_kp_u_and __pyx_mstate_global->__pyx_kp_u_and
4529 : #define __pyx_n_s_argsort __pyx_mstate_global->__pyx_n_s_argsort
4530 : #define __pyx_kp_u_arrays_in_prominence_data_must_h __pyx_mstate_global->__pyx_kp_u_arrays_in_prominence_data_must_h
4531 : #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
4532 : #define __pyx_n_s_base __pyx_mstate_global->__pyx_n_s_base
4533 : #define __pyx_n_s_bool __pyx_mstate_global->__pyx_n_s_bool
4534 : #define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
4535 : #define __pyx_n_u_c __pyx_mstate_global->__pyx_n_u_c
4536 : #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
4537 : #define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
4538 : #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
4539 : #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
4540 : #define __pyx_kp_s_collections_abc __pyx_mstate_global->__pyx_kp_s_collections_abc
4541 : #define __pyx_kp_s_contiguous_and_direct __pyx_mstate_global->__pyx_kp_s_contiguous_and_direct
4542 : #define __pyx_kp_s_contiguous_and_indirect __pyx_mstate_global->__pyx_kp_s_contiguous_and_indirect
4543 : #define __pyx_n_s_count __pyx_mstate_global->__pyx_n_s_count
4544 : #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
4545 : #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
4546 : #define __pyx_n_s_distance __pyx_mstate_global->__pyx_n_s_distance
4547 : #define __pyx_n_s_distance_2 __pyx_mstate_global->__pyx_n_s_distance_2
4548 : #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
4549 : #define __pyx_n_s_dtype __pyx_mstate_global->__pyx_n_s_dtype
4550 : #define __pyx_n_s_dtype_is_object __pyx_mstate_global->__pyx_n_s_dtype_is_object
4551 : #define __pyx_n_s_empty __pyx_mstate_global->__pyx_n_s_empty
4552 : #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
4553 : #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode
4554 : #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
4555 : #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
4556 : #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags
4557 : #define __pyx_n_s_float64 __pyx_mstate_global->__pyx_n_s_float64
4558 : #define __pyx_n_s_format __pyx_mstate_global->__pyx_n_s_format
4559 : #define __pyx_n_s_fortran __pyx_mstate_global->__pyx_n_s_fortran
4560 : #define __pyx_n_u_fortran __pyx_mstate_global->__pyx_n_u_fortran
4561 : #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
4562 : #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
4563 : #define __pyx_kp_u_got __pyx_mstate_global->__pyx_kp_u_got
4564 : #define __pyx_kp_u_got_differing_extents_in_dimensi __pyx_mstate_global->__pyx_kp_u_got_differing_extents_in_dimensi
4565 : #define __pyx_n_s_height __pyx_mstate_global->__pyx_n_s_height
4566 : #define __pyx_kp_s_home_czgdp18079_Quansight_scipy __pyx_mstate_global->__pyx_kp_s_home_czgdp18079_Quansight_scipy
4567 : #define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
4568 : #define __pyx_n_s_i_ahead __pyx_mstate_global->__pyx_n_s_i_ahead
4569 : #define __pyx_n_s_i_max __pyx_mstate_global->__pyx_n_s_i_max
4570 : #define __pyx_n_s_i_min __pyx_mstate_global->__pyx_n_s_i_min
4571 : #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
4572 : #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
4573 : #define __pyx_n_s_index __pyx_mstate_global->__pyx_n_s_index
4574 : #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
4575 : #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
4576 : #define __pyx_n_s_intp __pyx_mstate_global->__pyx_n_s_intp
4577 : #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
4578 : #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
4579 : #define __pyx_n_s_itemsize __pyx_mstate_global->__pyx_n_s_itemsize
4580 : #define __pyx_kp_s_itemsize_0_for_cython_array __pyx_mstate_global->__pyx_kp_s_itemsize_0_for_cython_array
4581 : #define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
4582 : #define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k
4583 : #define __pyx_n_s_keep __pyx_mstate_global->__pyx_n_s_keep
4584 : #define __pyx_n_s_left_bases __pyx_mstate_global->__pyx_n_s_left_bases
4585 : #define __pyx_n_s_left_edges __pyx_mstate_global->__pyx_n_s_left_edges
4586 : #define __pyx_n_s_left_ip __pyx_mstate_global->__pyx_n_s_left_ip
4587 : #define __pyx_n_s_left_ips __pyx_mstate_global->__pyx_n_s_left_ips
4588 : #define __pyx_n_s_left_min __pyx_mstate_global->__pyx_n_s_left_min
4589 : #define __pyx_n_s_local_maxima_1d __pyx_mstate_global->__pyx_n_s_local_maxima_1d
4590 : #define __pyx_n_u_local_maxima_1d __pyx_mstate_global->__pyx_n_u_local_maxima_1d
4591 : #define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m
4592 : #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
4593 : #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview
4594 : #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
4595 : #define __pyx_n_s_midpoints __pyx_mstate_global->__pyx_n_s_midpoints
4596 : #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode
4597 : #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
4598 : #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
4599 : #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
4600 : #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2
4601 : #define __pyx_n_s_ndim __pyx_mstate_global->__pyx_n_s_ndim
4602 : #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
4603 : #define __pyx_kp_s_no_default___reduce___due_to_non __pyx_mstate_global->__pyx_kp_s_no_default___reduce___due_to_non
4604 : #define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np
4605 : #define __pyx_n_s_numpy __pyx_mstate_global->__pyx_n_s_numpy
4606 : #define __pyx_kp_u_numpy__core_multiarray_failed_to __pyx_mstate_global->__pyx_kp_u_numpy__core_multiarray_failed_to
4607 : #define __pyx_kp_u_numpy__core_umath_failed_to_impo __pyx_mstate_global->__pyx_kp_u_numpy__core_umath_failed_to_impo
4608 : #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj
4609 : #define __pyx_n_s_ones __pyx_mstate_global->__pyx_n_s_ones
4610 : #define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p
4611 : #define __pyx_n_s_pack __pyx_mstate_global->__pyx_n_s_pack
4612 : #define __pyx_n_s_peak __pyx_mstate_global->__pyx_n_s_peak
4613 : #define __pyx_kp_u_peak_is_not_a_valid_index_for_x __pyx_mstate_global->__pyx_kp_u_peak_is_not_a_valid_index_for_x
4614 : #define __pyx_n_s_peak_nr __pyx_mstate_global->__pyx_n_s_peak_nr
4615 : #define __pyx_n_s_peak_prominences __pyx_mstate_global->__pyx_n_s_peak_prominences
4616 : #define __pyx_n_u_peak_prominences __pyx_mstate_global->__pyx_n_u_peak_prominences
4617 : #define __pyx_n_s_peak_widths __pyx_mstate_global->__pyx_n_s_peak_widths
4618 : #define __pyx_n_u_peak_widths __pyx_mstate_global->__pyx_n_u_peak_widths
4619 : #define __pyx_n_s_peaks __pyx_mstate_global->__pyx_n_s_peaks
4620 : #define __pyx_n_s_peaks_size __pyx_mstate_global->__pyx_n_s_peaks_size
4621 : #define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
4622 : #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
4623 : #define __pyx_n_s_priority __pyx_mstate_global->__pyx_n_s_priority
4624 : #define __pyx_n_s_priority_to_position __pyx_mstate_global->__pyx_n_s_priority_to_position
4625 : #define __pyx_kp_u_prominence_data_is_invalid_for_p __pyx_mstate_global->__pyx_kp_u_prominence_data_is_invalid_for_p
4626 : #define __pyx_n_s_prominences __pyx_mstate_global->__pyx_n_s_prominences
4627 : #define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
4628 : #define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
4629 : #define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
4630 : #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
4631 : #define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
4632 : #define __pyx_n_s_pyx_unpickle_Enum __pyx_mstate_global->__pyx_n_s_pyx_unpickle_Enum
4633 : #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
4634 : #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
4635 : #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
4636 : #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
4637 : #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
4638 : #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
4639 : #define __pyx_n_s_refcheck __pyx_mstate_global->__pyx_n_s_refcheck
4640 : #define __pyx_n_s_register __pyx_mstate_global->__pyx_n_s_register
4641 : #define __pyx_n_s_rel_height __pyx_mstate_global->__pyx_n_s_rel_height
4642 : #define __pyx_kp_u_rel_height_must_be_greater_or_e __pyx_mstate_global->__pyx_kp_u_rel_height_must_be_greater_or_e
4643 : #define __pyx_n_s_resize __pyx_mstate_global->__pyx_n_s_resize
4644 : #define __pyx_n_s_right_bases __pyx_mstate_global->__pyx_n_s_right_bases
4645 : #define __pyx_n_s_right_edges __pyx_mstate_global->__pyx_n_s_right_edges
4646 : #define __pyx_n_s_right_ip __pyx_mstate_global->__pyx_n_s_right_ip
4647 : #define __pyx_n_s_right_ips __pyx_mstate_global->__pyx_n_s_right_ips
4648 : #define __pyx_n_s_right_min __pyx_mstate_global->__pyx_n_s_right_min
4649 : #define __pyx_n_s_scipy_signal__peak_finding_utils __pyx_mstate_global->__pyx_n_s_scipy_signal__peak_finding_utils
4650 : #define __pyx_n_s_select_by_peak_distance __pyx_mstate_global->__pyx_n_s_select_by_peak_distance
4651 : #define __pyx_n_u_select_by_peak_distance __pyx_mstate_global->__pyx_n_u_select_by_peak_distance
4652 : #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
4653 : #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
4654 : #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
4655 : #define __pyx_n_s_shape __pyx_mstate_global->__pyx_n_s_shape
4656 : #define __pyx_n_s_show_warning __pyx_mstate_global->__pyx_n_s_show_warning
4657 : #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
4658 : #define __pyx_kp_u_some_peaks_have_a_prominence_of __pyx_mstate_global->__pyx_kp_u_some_peaks_have_a_prominence_of
4659 : #define __pyx_kp_u_some_peaks_have_a_width_of_0 __pyx_mstate_global->__pyx_kp_u_some_peaks_have_a_width_of_0
4660 : #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
4661 : #define __pyx_n_s_stacklevel __pyx_mstate_global->__pyx_n_s_stacklevel
4662 : #define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
4663 : #define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
4664 : #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
4665 : #define __pyx_kp_s_strided_and_direct __pyx_mstate_global->__pyx_kp_s_strided_and_direct
4666 : #define __pyx_kp_s_strided_and_direct_or_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_direct_or_indirect
4667 : #define __pyx_kp_s_strided_and_indirect __pyx_mstate_global->__pyx_kp_s_strided_and_indirect
4668 : #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
4669 : #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
4670 : #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
4671 : #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
4672 : #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
4673 : #define __pyx_n_s_uint8 __pyx_mstate_global->__pyx_n_s_uint8
4674 : #define __pyx_kp_s_unable_to_allocate_array_data __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_array_data
4675 : #define __pyx_kp_s_unable_to_allocate_shape_and_str __pyx_mstate_global->__pyx_kp_s_unable_to_allocate_shape_and_str
4676 : #define __pyx_n_s_unpack __pyx_mstate_global->__pyx_n_s_unpack
4677 : #define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
4678 : #define __pyx_n_s_version_info __pyx_mstate_global->__pyx_n_s_version_info
4679 : #define __pyx_n_s_view __pyx_mstate_global->__pyx_n_s_view
4680 : #define __pyx_n_s_warn __pyx_mstate_global->__pyx_n_s_warn
4681 : #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
4682 : #define __pyx_n_s_width_heights __pyx_mstate_global->__pyx_n_s_width_heights
4683 : #define __pyx_n_s_widths __pyx_mstate_global->__pyx_n_s_widths
4684 : #define __pyx_n_s_wlen __pyx_mstate_global->__pyx_n_s_wlen
4685 : #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x
4686 : #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
4687 : #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
4688 : #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
4689 : #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3
4690 : #define __pyx_int_112105877 __pyx_mstate_global->__pyx_int_112105877
4691 : #define __pyx_int_136983863 __pyx_mstate_global->__pyx_int_136983863
4692 : #define __pyx_int_184977713 __pyx_mstate_global->__pyx_int_184977713
4693 : #define __pyx_int_neg_1 __pyx_mstate_global->__pyx_int_neg_1
4694 : #define __pyx_slice__5 __pyx_mstate_global->__pyx_slice__5
4695 : #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
4696 : #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
4697 : #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
4698 : #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
4699 : #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
4700 : #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
4701 : #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
4702 : #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
4703 : #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
4704 : #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
4705 : #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
4706 : #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
4707 : #define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
4708 : #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
4709 : #define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
4710 : #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
4711 : #define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
4712 : #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
4713 : #define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
4714 : #define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
4715 : #define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
4716 : #define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32
4717 : #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23
4718 : #define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25
4719 : #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27
4720 : #define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31
4721 : #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33
4722 : /* #### Code section: module_code ### */
4723 :
4724 : /* "View.MemoryView":131
4725 : * cdef bint dtype_is_object
4726 : *
4727 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4728 : * mode="c", bint allocate_buffer=True):
4729 : *
4730 : */
4731 :
4732 : /* Python wrapper */
4733 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4734 0 : static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4735 0 : PyObject *__pyx_v_shape = 0;
4736 0 : Py_ssize_t __pyx_v_itemsize;
4737 0 : PyObject *__pyx_v_format = 0;
4738 0 : PyObject *__pyx_v_mode = 0;
4739 0 : int __pyx_v_allocate_buffer;
4740 0 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
4741 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
4742 0 : PyObject* values[5] = {0,0,0,0,0};
4743 0 : int __pyx_lineno = 0;
4744 0 : const char *__pyx_filename = NULL;
4745 0 : int __pyx_clineno = 0;
4746 0 : int __pyx_r;
4747 : __Pyx_RefNannyDeclarations
4748 0 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
4749 : #if CYTHON_ASSUME_SAFE_MACROS
4750 0 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
4751 : #else
4752 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
4753 : #endif
4754 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
4755 : {
4756 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
4757 0 : values[3] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_n_s_c));
4758 0 : if (__pyx_kwds) {
4759 0 : Py_ssize_t kw_args;
4760 0 : switch (__pyx_nargs) {
4761 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
4762 0 : CYTHON_FALLTHROUGH;
4763 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
4764 0 : CYTHON_FALLTHROUGH;
4765 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
4766 0 : CYTHON_FALLTHROUGH;
4767 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
4768 0 : CYTHON_FALLTHROUGH;
4769 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
4770 0 : CYTHON_FALLTHROUGH;
4771 0 : case 0: break;
4772 0 : default: goto __pyx_L5_argtuple_error;
4773 : }
4774 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
4775 0 : switch (__pyx_nargs) {
4776 0 : case 0:
4777 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_shape)) != 0)) {
4778 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
4779 0 : kw_args--;
4780 : }
4781 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4782 0 : else goto __pyx_L5_argtuple_error;
4783 0 : CYTHON_FALLTHROUGH;
4784 : case 1:
4785 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_itemsize)) != 0)) {
4786 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
4787 0 : kw_args--;
4788 : }
4789 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4790 : else {
4791 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 131, __pyx_L3_error)
4792 : }
4793 0 : CYTHON_FALLTHROUGH;
4794 : case 2:
4795 0 : if (likely((values[2] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_format)) != 0)) {
4796 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[2]);
4797 0 : kw_args--;
4798 : }
4799 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4800 : else {
4801 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 131, __pyx_L3_error)
4802 : }
4803 0 : CYTHON_FALLTHROUGH;
4804 : case 3:
4805 0 : if (kw_args > 0) {
4806 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_mode);
4807 0 : if (value) { values[3] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
4808 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4809 : }
4810 0 : CYTHON_FALLTHROUGH;
4811 : case 4:
4812 0 : if (kw_args > 0) {
4813 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_allocate_buffer);
4814 0 : if (value) { values[4] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
4815 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4816 : }
4817 : }
4818 0 : if (unlikely(kw_args > 0)) {
4819 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
4820 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 131, __pyx_L3_error)
4821 : }
4822 : } else {
4823 0 : switch (__pyx_nargs) {
4824 0 : case 5: values[4] = __Pyx_Arg_VARARGS(__pyx_args, 4);
4825 0 : CYTHON_FALLTHROUGH;
4826 0 : case 4: values[3] = __Pyx_Arg_VARARGS(__pyx_args, 3);
4827 0 : CYTHON_FALLTHROUGH;
4828 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
4829 0 : values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
4830 0 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
4831 0 : break;
4832 0 : default: goto __pyx_L5_argtuple_error;
4833 : }
4834 : }
4835 0 : __pyx_v_shape = ((PyObject*)values[0]);
4836 0 : __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L3_error)
4837 0 : __pyx_v_format = values[2];
4838 0 : __pyx_v_mode = values[3];
4839 0 : if (values[4]) {
4840 0 : __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 132, __pyx_L3_error)
4841 : } else {
4842 :
4843 : /* "View.MemoryView":132
4844 : *
4845 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
4846 : * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
4847 : *
4848 : * cdef int idx
4849 : */
4850 : __pyx_v_allocate_buffer = ((int)1);
4851 : }
4852 : }
4853 0 : goto __pyx_L6_skip;
4854 0 : __pyx_L5_argtuple_error:;
4855 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, __pyx_nargs); __PYX_ERR(1, 131, __pyx_L3_error)
4856 0 : __pyx_L6_skip:;
4857 0 : goto __pyx_L4_argument_unpacking_done;
4858 0 : __pyx_L3_error:;
4859 : {
4860 0 : Py_ssize_t __pyx_temp;
4861 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4862 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
4863 : }
4864 : }
4865 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4866 0 : __Pyx_RefNannyFinishContext();
4867 0 : return -1;
4868 0 : __pyx_L4_argument_unpacking_done:;
4869 0 : if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 131, __pyx_L1_error)
4870 0 : if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
4871 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 131, __pyx_L1_error)
4872 : }
4873 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
4874 :
4875 : /* "View.MemoryView":131
4876 : * cdef bint dtype_is_object
4877 : *
4878 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
4879 : * mode="c", bint allocate_buffer=True):
4880 : *
4881 : */
4882 :
4883 : /* function exit code */
4884 0 : goto __pyx_L0;
4885 : __pyx_L1_error:;
4886 : __pyx_r = -1;
4887 0 : __pyx_L0:;
4888 : {
4889 0 : Py_ssize_t __pyx_temp;
4890 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
4891 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
4892 : }
4893 : }
4894 : __Pyx_RefNannyFinishContext();
4895 : return __pyx_r;
4896 : }
4897 :
4898 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
4899 0 : int __pyx_v_idx;
4900 0 : Py_ssize_t __pyx_v_dim;
4901 0 : char __pyx_v_order;
4902 0 : int __pyx_r;
4903 : __Pyx_RefNannyDeclarations
4904 0 : Py_ssize_t __pyx_t_1;
4905 0 : int __pyx_t_2;
4906 0 : int __pyx_t_3;
4907 0 : PyObject *__pyx_t_4 = NULL;
4908 0 : PyObject *__pyx_t_5 = NULL;
4909 0 : PyObject *__pyx_t_6 = NULL;
4910 0 : unsigned int __pyx_t_7;
4911 0 : char *__pyx_t_8;
4912 0 : int __pyx_t_9;
4913 0 : Py_ssize_t __pyx_t_10;
4914 0 : Py_UCS4 __pyx_t_11;
4915 0 : int __pyx_lineno = 0;
4916 0 : const char *__pyx_filename = NULL;
4917 0 : int __pyx_clineno = 0;
4918 0 : __Pyx_RefNannySetupContext("__cinit__", 0);
4919 0 : __Pyx_INCREF(__pyx_v_format);
4920 :
4921 : /* "View.MemoryView":137
4922 : * cdef Py_ssize_t dim
4923 : *
4924 : * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
4925 : * self.itemsize = itemsize
4926 : *
4927 : */
4928 0 : if (unlikely(__pyx_v_shape == Py_None)) {
4929 0 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
4930 0 : __PYX_ERR(1, 137, __pyx_L1_error)
4931 : }
4932 0 : __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 137, __pyx_L1_error)
4933 0 : __pyx_v_self->ndim = ((int)__pyx_t_1);
4934 :
4935 : /* "View.MemoryView":138
4936 : *
4937 : * self.ndim = <int> len(shape)
4938 : * self.itemsize = itemsize # <<<<<<<<<<<<<<
4939 : *
4940 : * if not self.ndim:
4941 : */
4942 0 : __pyx_v_self->itemsize = __pyx_v_itemsize;
4943 :
4944 : /* "View.MemoryView":140
4945 : * self.itemsize = itemsize
4946 : *
4947 : * if not self.ndim: # <<<<<<<<<<<<<<
4948 : * raise ValueError, "Empty shape tuple for cython.array"
4949 : *
4950 : */
4951 0 : __pyx_t_2 = (!(__pyx_v_self->ndim != 0));
4952 0 : if (unlikely(__pyx_t_2)) {
4953 :
4954 : /* "View.MemoryView":141
4955 : *
4956 : * if not self.ndim:
4957 : * raise ValueError, "Empty shape tuple for cython.array" # <<<<<<<<<<<<<<
4958 : *
4959 : * if itemsize <= 0:
4960 : */
4961 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Empty_shape_tuple_for_cython_arr, 0, 0);
4962 0 : __PYX_ERR(1, 141, __pyx_L1_error)
4963 :
4964 : /* "View.MemoryView":140
4965 : * self.itemsize = itemsize
4966 : *
4967 : * if not self.ndim: # <<<<<<<<<<<<<<
4968 : * raise ValueError, "Empty shape tuple for cython.array"
4969 : *
4970 : */
4971 : }
4972 :
4973 : /* "View.MemoryView":143
4974 : * raise ValueError, "Empty shape tuple for cython.array"
4975 : *
4976 : * if itemsize <= 0: # <<<<<<<<<<<<<<
4977 : * raise ValueError, "itemsize <= 0 for cython.array"
4978 : *
4979 : */
4980 0 : __pyx_t_2 = (__pyx_v_itemsize <= 0);
4981 0 : if (unlikely(__pyx_t_2)) {
4982 :
4983 : /* "View.MemoryView":144
4984 : *
4985 : * if itemsize <= 0:
4986 : * raise ValueError, "itemsize <= 0 for cython.array" # <<<<<<<<<<<<<<
4987 : *
4988 : * if not isinstance(format, bytes):
4989 : */
4990 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_itemsize_0_for_cython_array, 0, 0);
4991 0 : __PYX_ERR(1, 144, __pyx_L1_error)
4992 :
4993 : /* "View.MemoryView":143
4994 : * raise ValueError, "Empty shape tuple for cython.array"
4995 : *
4996 : * if itemsize <= 0: # <<<<<<<<<<<<<<
4997 : * raise ValueError, "itemsize <= 0 for cython.array"
4998 : *
4999 : */
5000 : }
5001 :
5002 : /* "View.MemoryView":146
5003 : * raise ValueError, "itemsize <= 0 for cython.array"
5004 : *
5005 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5006 : * format = format.encode('ASCII')
5007 : * self._format = format # keep a reference to the byte string
5008 : */
5009 0 : __pyx_t_2 = PyBytes_Check(__pyx_v_format);
5010 0 : __pyx_t_3 = (!__pyx_t_2);
5011 0 : if (__pyx_t_3) {
5012 :
5013 : /* "View.MemoryView":147
5014 : *
5015 : * if not isinstance(format, bytes):
5016 : * format = format.encode('ASCII') # <<<<<<<<<<<<<<
5017 : * self._format = format # keep a reference to the byte string
5018 : * self.format = self._format
5019 : */
5020 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 147, __pyx_L1_error)
5021 0 : __Pyx_GOTREF(__pyx_t_5);
5022 0 : __pyx_t_6 = NULL;
5023 0 : __pyx_t_7 = 0;
5024 : #if CYTHON_UNPACK_METHODS
5025 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
5026 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5027 0 : if (likely(__pyx_t_6)) {
5028 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5029 0 : __Pyx_INCREF(__pyx_t_6);
5030 0 : __Pyx_INCREF(function);
5031 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
5032 : __pyx_t_7 = 1;
5033 : }
5034 : }
5035 : #endif
5036 : {
5037 0 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_n_s_ASCII};
5038 0 : __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
5039 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5040 0 : if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 147, __pyx_L1_error)
5041 0 : __Pyx_GOTREF(__pyx_t_4);
5042 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5043 : }
5044 0 : __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_4);
5045 : __pyx_t_4 = 0;
5046 :
5047 : /* "View.MemoryView":146
5048 : * raise ValueError, "itemsize <= 0 for cython.array"
5049 : *
5050 : * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
5051 : * format = format.encode('ASCII')
5052 : * self._format = format # keep a reference to the byte string
5053 : */
5054 : }
5055 :
5056 : /* "View.MemoryView":148
5057 : * if not isinstance(format, bytes):
5058 : * format = format.encode('ASCII')
5059 : * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
5060 : * self.format = self._format
5061 : *
5062 : */
5063 0 : if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_v_format))) __PYX_ERR(1, 148, __pyx_L1_error)
5064 0 : __pyx_t_4 = __pyx_v_format;
5065 0 : __Pyx_INCREF(__pyx_t_4);
5066 0 : __Pyx_GIVEREF(__pyx_t_4);
5067 0 : __Pyx_GOTREF(__pyx_v_self->_format);
5068 0 : __Pyx_DECREF(__pyx_v_self->_format);
5069 0 : __pyx_v_self->_format = ((PyObject*)__pyx_t_4);
5070 0 : __pyx_t_4 = 0;
5071 :
5072 : /* "View.MemoryView":149
5073 : * format = format.encode('ASCII')
5074 : * self._format = format # keep a reference to the byte string
5075 : * self.format = self._format # <<<<<<<<<<<<<<
5076 : *
5077 : *
5078 : */
5079 0 : if (unlikely(__pyx_v_self->_format == Py_None)) {
5080 0 : PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
5081 0 : __PYX_ERR(1, 149, __pyx_L1_error)
5082 : }
5083 0 : __pyx_t_8 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
5084 0 : __pyx_v_self->format = __pyx_t_8;
5085 :
5086 : /* "View.MemoryView":152
5087 : *
5088 : *
5089 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
5090 : * self._strides = self._shape + self.ndim
5091 : *
5092 : */
5093 0 : __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
5094 :
5095 : /* "View.MemoryView":153
5096 : *
5097 : * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
5098 : * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
5099 : *
5100 : * if not self._shape:
5101 : */
5102 0 : __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
5103 :
5104 : /* "View.MemoryView":155
5105 : * self._strides = self._shape + self.ndim
5106 : *
5107 : * if not self._shape: # <<<<<<<<<<<<<<
5108 : * raise MemoryError, "unable to allocate shape and strides."
5109 : *
5110 : */
5111 0 : __pyx_t_3 = (!(__pyx_v_self->_shape != 0));
5112 0 : if (unlikely(__pyx_t_3)) {
5113 :
5114 : /* "View.MemoryView":156
5115 : *
5116 : * if not self._shape:
5117 : * raise MemoryError, "unable to allocate shape and strides." # <<<<<<<<<<<<<<
5118 : *
5119 : *
5120 : */
5121 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_shape_and_str, 0, 0);
5122 0 : __PYX_ERR(1, 156, __pyx_L1_error)
5123 :
5124 : /* "View.MemoryView":155
5125 : * self._strides = self._shape + self.ndim
5126 : *
5127 : * if not self._shape: # <<<<<<<<<<<<<<
5128 : * raise MemoryError, "unable to allocate shape and strides."
5129 : *
5130 : */
5131 : }
5132 :
5133 : /* "View.MemoryView":159
5134 : *
5135 : *
5136 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5137 : * if dim <= 0:
5138 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5139 : */
5140 0 : __pyx_t_9 = 0;
5141 0 : __pyx_t_4 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_4);
5142 : __pyx_t_1 = 0;
5143 0 : for (;;) {
5144 0 : {
5145 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
5146 : #if !CYTHON_ASSUME_SAFE_MACROS
5147 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5148 : #endif
5149 0 : if (__pyx_t_1 >= __pyx_temp) break;
5150 : }
5151 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5152 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(1, 159, __pyx_L1_error)
5153 : #else
5154 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 159, __pyx_L1_error)
5155 : __Pyx_GOTREF(__pyx_t_5);
5156 : #endif
5157 0 : __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 159, __pyx_L1_error)
5158 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5159 0 : __pyx_v_dim = __pyx_t_10;
5160 0 : __pyx_v_idx = __pyx_t_9;
5161 0 : __pyx_t_9 = (__pyx_t_9 + 1);
5162 :
5163 : /* "View.MemoryView":160
5164 : *
5165 : * for idx, dim in enumerate(shape):
5166 : * if dim <= 0: # <<<<<<<<<<<<<<
5167 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5168 : * self._shape[idx] = dim
5169 : */
5170 0 : __pyx_t_3 = (__pyx_v_dim <= 0);
5171 0 : if (unlikely(__pyx_t_3)) {
5172 :
5173 : /* "View.MemoryView":161
5174 : * for idx, dim in enumerate(shape):
5175 : * if dim <= 0:
5176 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}." # <<<<<<<<<<<<<<
5177 : * self._shape[idx] = dim
5178 : *
5179 : */
5180 0 : __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 161, __pyx_L1_error)
5181 0 : __Pyx_GOTREF(__pyx_t_5);
5182 0 : __pyx_t_10 = 0;
5183 0 : __pyx_t_11 = 127;
5184 0 : __Pyx_INCREF(__pyx_kp_u_Invalid_shape_in_axis);
5185 0 : __pyx_t_10 += 22;
5186 0 : __Pyx_GIVEREF(__pyx_kp_u_Invalid_shape_in_axis);
5187 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_shape_in_axis);
5188 0 : __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5189 0 : __Pyx_GOTREF(__pyx_t_6);
5190 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5191 0 : __Pyx_GIVEREF(__pyx_t_6);
5192 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
5193 0 : __pyx_t_6 = 0;
5194 0 : __Pyx_INCREF(__pyx_kp_u_);
5195 0 : __pyx_t_10 += 2;
5196 0 : __Pyx_GIVEREF(__pyx_kp_u_);
5197 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u_);
5198 0 : __pyx_t_6 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5199 0 : __Pyx_GOTREF(__pyx_t_6);
5200 0 : __pyx_t_10 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
5201 0 : __Pyx_GIVEREF(__pyx_t_6);
5202 0 : PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_6);
5203 0 : __pyx_t_6 = 0;
5204 0 : __Pyx_INCREF(__pyx_kp_u__2);
5205 0 : __pyx_t_10 += 1;
5206 0 : __Pyx_GIVEREF(__pyx_kp_u__2);
5207 0 : PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__2);
5208 0 : __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 161, __pyx_L1_error)
5209 0 : __Pyx_GOTREF(__pyx_t_6);
5210 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5211 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5212 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5213 0 : __PYX_ERR(1, 161, __pyx_L1_error)
5214 :
5215 : /* "View.MemoryView":160
5216 : *
5217 : * for idx, dim in enumerate(shape):
5218 : * if dim <= 0: # <<<<<<<<<<<<<<
5219 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5220 : * self._shape[idx] = dim
5221 : */
5222 : }
5223 :
5224 : /* "View.MemoryView":162
5225 : * if dim <= 0:
5226 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5227 : * self._shape[idx] = dim # <<<<<<<<<<<<<<
5228 : *
5229 : * cdef char order
5230 : */
5231 0 : (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
5232 :
5233 : /* "View.MemoryView":159
5234 : *
5235 : *
5236 : * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
5237 : * if dim <= 0:
5238 : * raise ValueError, f"Invalid shape in axis {idx}: {dim}."
5239 : */
5240 : }
5241 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5242 :
5243 : /* "View.MemoryView":165
5244 : *
5245 : * cdef char order
5246 : * if mode == 'c': # <<<<<<<<<<<<<<
5247 : * order = b'C'
5248 : * self.mode = u'c'
5249 : */
5250 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 165, __pyx_L1_error)
5251 0 : if (__pyx_t_3) {
5252 :
5253 : /* "View.MemoryView":166
5254 : * cdef char order
5255 : * if mode == 'c':
5256 : * order = b'C' # <<<<<<<<<<<<<<
5257 : * self.mode = u'c'
5258 : * elif mode == 'fortran':
5259 : */
5260 0 : __pyx_v_order = 'C';
5261 :
5262 : /* "View.MemoryView":167
5263 : * if mode == 'c':
5264 : * order = b'C'
5265 : * self.mode = u'c' # <<<<<<<<<<<<<<
5266 : * elif mode == 'fortran':
5267 : * order = b'F'
5268 : */
5269 0 : __Pyx_INCREF(__pyx_n_u_c);
5270 0 : __Pyx_GIVEREF(__pyx_n_u_c);
5271 0 : __Pyx_GOTREF(__pyx_v_self->mode);
5272 0 : __Pyx_DECREF(__pyx_v_self->mode);
5273 0 : __pyx_v_self->mode = __pyx_n_u_c;
5274 :
5275 : /* "View.MemoryView":165
5276 : *
5277 : * cdef char order
5278 : * if mode == 'c': # <<<<<<<<<<<<<<
5279 : * order = b'C'
5280 : * self.mode = u'c'
5281 : */
5282 0 : goto __pyx_L11;
5283 : }
5284 :
5285 : /* "View.MemoryView":168
5286 : * order = b'C'
5287 : * self.mode = u'c'
5288 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
5289 : * order = b'F'
5290 : * self.mode = u'fortran'
5291 : */
5292 0 : __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(1, 168, __pyx_L1_error)
5293 0 : if (likely(__pyx_t_3)) {
5294 :
5295 : /* "View.MemoryView":169
5296 : * self.mode = u'c'
5297 : * elif mode == 'fortran':
5298 : * order = b'F' # <<<<<<<<<<<<<<
5299 : * self.mode = u'fortran'
5300 : * else:
5301 : */
5302 0 : __pyx_v_order = 'F';
5303 :
5304 : /* "View.MemoryView":170
5305 : * elif mode == 'fortran':
5306 : * order = b'F'
5307 : * self.mode = u'fortran' # <<<<<<<<<<<<<<
5308 : * else:
5309 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5310 : */
5311 0 : __Pyx_INCREF(__pyx_n_u_fortran);
5312 0 : __Pyx_GIVEREF(__pyx_n_u_fortran);
5313 0 : __Pyx_GOTREF(__pyx_v_self->mode);
5314 0 : __Pyx_DECREF(__pyx_v_self->mode);
5315 0 : __pyx_v_self->mode = __pyx_n_u_fortran;
5316 :
5317 : /* "View.MemoryView":168
5318 : * order = b'C'
5319 : * self.mode = u'c'
5320 : * elif mode == 'fortran': # <<<<<<<<<<<<<<
5321 : * order = b'F'
5322 : * self.mode = u'fortran'
5323 : */
5324 0 : goto __pyx_L11;
5325 : }
5326 :
5327 : /* "View.MemoryView":172
5328 : * self.mode = u'fortran'
5329 : * else:
5330 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}" # <<<<<<<<<<<<<<
5331 : *
5332 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5333 : */
5334 : /*else*/ {
5335 0 : __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_mode, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 172, __pyx_L1_error)
5336 0 : __Pyx_GOTREF(__pyx_t_4);
5337 0 : __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 172, __pyx_L1_error)
5338 0 : __Pyx_GOTREF(__pyx_t_6);
5339 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5340 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_6, 0, 0);
5341 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5342 0 : __PYX_ERR(1, 172, __pyx_L1_error)
5343 : }
5344 0 : __pyx_L11:;
5345 :
5346 : /* "View.MemoryView":174
5347 : * raise ValueError, f"Invalid mode, expected 'c' or 'fortran', got {mode}"
5348 : *
5349 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order) # <<<<<<<<<<<<<<
5350 : *
5351 : * self.free_data = allocate_buffer
5352 : */
5353 0 : __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
5354 :
5355 : /* "View.MemoryView":176
5356 : * self.len = fill_contig_strides_array(self._shape, self._strides, itemsize, self.ndim, order)
5357 : *
5358 : * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
5359 : * self.dtype_is_object = format == b'O'
5360 : *
5361 : */
5362 0 : __pyx_v_self->free_data = __pyx_v_allocate_buffer;
5363 :
5364 : /* "View.MemoryView":177
5365 : *
5366 : * self.free_data = allocate_buffer
5367 : * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
5368 : *
5369 : * if allocate_buffer:
5370 : */
5371 0 : __pyx_t_6 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 177, __pyx_L1_error)
5372 0 : __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 177, __pyx_L1_error)
5373 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5374 0 : __pyx_v_self->dtype_is_object = __pyx_t_3;
5375 :
5376 : /* "View.MemoryView":179
5377 : * self.dtype_is_object = format == b'O'
5378 : *
5379 : * if allocate_buffer: # <<<<<<<<<<<<<<
5380 : * _allocate_buffer(self)
5381 : *
5382 : */
5383 0 : if (__pyx_v_allocate_buffer) {
5384 :
5385 : /* "View.MemoryView":180
5386 : *
5387 : * if allocate_buffer:
5388 : * _allocate_buffer(self) # <<<<<<<<<<<<<<
5389 : *
5390 : * @cname('getbuffer')
5391 : */
5392 0 : __pyx_t_9 = __pyx_array_allocate_buffer(__pyx_v_self); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 180, __pyx_L1_error)
5393 :
5394 : /* "View.MemoryView":179
5395 : * self.dtype_is_object = format == b'O'
5396 : *
5397 : * if allocate_buffer: # <<<<<<<<<<<<<<
5398 : * _allocate_buffer(self)
5399 : *
5400 : */
5401 : }
5402 :
5403 : /* "View.MemoryView":131
5404 : * cdef bint dtype_is_object
5405 : *
5406 : * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
5407 : * mode="c", bint allocate_buffer=True):
5408 : *
5409 : */
5410 :
5411 : /* function exit code */
5412 0 : __pyx_r = 0;
5413 0 : goto __pyx_L0;
5414 0 : __pyx_L1_error:;
5415 0 : __Pyx_XDECREF(__pyx_t_4);
5416 0 : __Pyx_XDECREF(__pyx_t_5);
5417 0 : __Pyx_XDECREF(__pyx_t_6);
5418 0 : __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5419 0 : __pyx_r = -1;
5420 0 : __pyx_L0:;
5421 0 : __Pyx_XDECREF(__pyx_v_format);
5422 0 : __Pyx_RefNannyFinishContext();
5423 0 : return __pyx_r;
5424 : }
5425 :
5426 : /* "View.MemoryView":182
5427 : * _allocate_buffer(self)
5428 : *
5429 : * @cname('getbuffer') # <<<<<<<<<<<<<<
5430 : * def __getbuffer__(self, Py_buffer *info, int flags):
5431 : * cdef int bufmode = -1
5432 : */
5433 :
5434 : /* Python wrapper */
5435 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5436 0 : CYTHON_UNUSED static int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5437 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5438 0 : int __pyx_r;
5439 : __Pyx_RefNannyDeclarations
5440 0 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5441 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5442 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5443 :
5444 : /* function exit code */
5445 0 : __Pyx_RefNannyFinishContext();
5446 0 : return __pyx_r;
5447 : }
5448 :
5449 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5450 0 : int __pyx_v_bufmode;
5451 0 : int __pyx_r;
5452 : __Pyx_RefNannyDeclarations
5453 0 : int __pyx_t_1;
5454 0 : char *__pyx_t_2;
5455 0 : Py_ssize_t __pyx_t_3;
5456 0 : int __pyx_t_4;
5457 0 : Py_ssize_t *__pyx_t_5;
5458 0 : int __pyx_lineno = 0;
5459 0 : const char *__pyx_filename = NULL;
5460 0 : int __pyx_clineno = 0;
5461 0 : if (unlikely(__pyx_v_info == NULL)) {
5462 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5463 0 : return -1;
5464 : }
5465 0 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
5466 0 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5467 0 : __Pyx_GIVEREF(__pyx_v_info->obj);
5468 :
5469 : /* "View.MemoryView":184
5470 : * @cname('getbuffer')
5471 : * def __getbuffer__(self, Py_buffer *info, int flags):
5472 : * cdef int bufmode = -1 # <<<<<<<<<<<<<<
5473 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5474 : * if self.mode == u"c":
5475 : */
5476 0 : __pyx_v_bufmode = -1;
5477 :
5478 : /* "View.MemoryView":185
5479 : * def __getbuffer__(self, Py_buffer *info, int flags):
5480 : * cdef int bufmode = -1
5481 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5482 : * if self.mode == u"c":
5483 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5484 : */
5485 0 : __pyx_t_1 = ((__pyx_v_flags & ((PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS) | PyBUF_ANY_CONTIGUOUS)) != 0);
5486 0 : if (__pyx_t_1) {
5487 :
5488 : /* "View.MemoryView":186
5489 : * cdef int bufmode = -1
5490 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5491 : * if self.mode == u"c": # <<<<<<<<<<<<<<
5492 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5493 : * elif self.mode == u"fortran":
5494 : */
5495 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 186, __pyx_L1_error)
5496 0 : if (__pyx_t_1) {
5497 :
5498 : /* "View.MemoryView":187
5499 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5500 : * if self.mode == u"c":
5501 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5502 : * elif self.mode == u"fortran":
5503 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5504 : */
5505 0 : __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5506 :
5507 : /* "View.MemoryView":186
5508 : * cdef int bufmode = -1
5509 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS):
5510 : * if self.mode == u"c": # <<<<<<<<<<<<<<
5511 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5512 : * elif self.mode == u"fortran":
5513 : */
5514 0 : goto __pyx_L4;
5515 : }
5516 :
5517 : /* "View.MemoryView":188
5518 : * if self.mode == u"c":
5519 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5520 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5521 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5522 : * if not (flags & bufmode):
5523 : */
5524 0 : __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 188, __pyx_L1_error)
5525 0 : if (__pyx_t_1) {
5526 :
5527 : /* "View.MemoryView":189
5528 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5529 : * elif self.mode == u"fortran":
5530 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
5531 : * if not (flags & bufmode):
5532 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5533 : */
5534 0 : __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
5535 :
5536 : /* "View.MemoryView":188
5537 : * if self.mode == u"c":
5538 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5539 : * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
5540 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5541 : * if not (flags & bufmode):
5542 : */
5543 : }
5544 0 : __pyx_L4:;
5545 :
5546 : /* "View.MemoryView":190
5547 : * elif self.mode == u"fortran":
5548 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5549 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
5550 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5551 : * info.buf = self.data
5552 : */
5553 0 : __pyx_t_1 = (!((__pyx_v_flags & __pyx_v_bufmode) != 0));
5554 0 : if (unlikely(__pyx_t_1)) {
5555 :
5556 : /* "View.MemoryView":191
5557 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5558 : * if not (flags & bufmode):
5559 : * raise ValueError, "Can only create a buffer that is contiguous in memory." # <<<<<<<<<<<<<<
5560 : * info.buf = self.data
5561 : * info.len = self.len
5562 : */
5563 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Can_only_create_a_buffer_that_is, 0, 0);
5564 0 : __PYX_ERR(1, 191, __pyx_L1_error)
5565 :
5566 : /* "View.MemoryView":190
5567 : * elif self.mode == u"fortran":
5568 : * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5569 : * if not (flags & bufmode): # <<<<<<<<<<<<<<
5570 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5571 : * info.buf = self.data
5572 : */
5573 : }
5574 :
5575 : /* "View.MemoryView":185
5576 : * def __getbuffer__(self, Py_buffer *info, int flags):
5577 : * cdef int bufmode = -1
5578 : * if flags & (PyBUF_C_CONTIGUOUS | PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS): # <<<<<<<<<<<<<<
5579 : * if self.mode == u"c":
5580 : * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
5581 : */
5582 : }
5583 :
5584 : /* "View.MemoryView":192
5585 : * if not (flags & bufmode):
5586 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5587 : * info.buf = self.data # <<<<<<<<<<<<<<
5588 : * info.len = self.len
5589 : *
5590 : */
5591 0 : __pyx_t_2 = __pyx_v_self->data;
5592 0 : __pyx_v_info->buf = __pyx_t_2;
5593 :
5594 : /* "View.MemoryView":193
5595 : * raise ValueError, "Can only create a buffer that is contiguous in memory."
5596 : * info.buf = self.data
5597 : * info.len = self.len # <<<<<<<<<<<<<<
5598 : *
5599 : * if flags & PyBUF_STRIDES:
5600 : */
5601 0 : __pyx_t_3 = __pyx_v_self->len;
5602 0 : __pyx_v_info->len = __pyx_t_3;
5603 :
5604 : /* "View.MemoryView":195
5605 : * info.len = self.len
5606 : *
5607 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5608 : * info.ndim = self.ndim
5609 : * info.shape = self._shape
5610 : */
5611 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
5612 0 : if (__pyx_t_1) {
5613 :
5614 : /* "View.MemoryView":196
5615 : *
5616 : * if flags & PyBUF_STRIDES:
5617 : * info.ndim = self.ndim # <<<<<<<<<<<<<<
5618 : * info.shape = self._shape
5619 : * info.strides = self._strides
5620 : */
5621 0 : __pyx_t_4 = __pyx_v_self->ndim;
5622 0 : __pyx_v_info->ndim = __pyx_t_4;
5623 :
5624 : /* "View.MemoryView":197
5625 : * if flags & PyBUF_STRIDES:
5626 : * info.ndim = self.ndim
5627 : * info.shape = self._shape # <<<<<<<<<<<<<<
5628 : * info.strides = self._strides
5629 : * else:
5630 : */
5631 0 : __pyx_t_5 = __pyx_v_self->_shape;
5632 0 : __pyx_v_info->shape = __pyx_t_5;
5633 :
5634 : /* "View.MemoryView":198
5635 : * info.ndim = self.ndim
5636 : * info.shape = self._shape
5637 : * info.strides = self._strides # <<<<<<<<<<<<<<
5638 : * else:
5639 : * info.ndim = 1
5640 : */
5641 0 : __pyx_t_5 = __pyx_v_self->_strides;
5642 0 : __pyx_v_info->strides = __pyx_t_5;
5643 :
5644 : /* "View.MemoryView":195
5645 : * info.len = self.len
5646 : *
5647 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
5648 : * info.ndim = self.ndim
5649 : * info.shape = self._shape
5650 : */
5651 0 : goto __pyx_L6;
5652 : }
5653 :
5654 : /* "View.MemoryView":200
5655 : * info.strides = self._strides
5656 : * else:
5657 : * info.ndim = 1 # <<<<<<<<<<<<<<
5658 : * info.shape = &self.len if flags & PyBUF_ND else NULL
5659 : * info.strides = NULL
5660 : */
5661 : /*else*/ {
5662 0 : __pyx_v_info->ndim = 1;
5663 :
5664 : /* "View.MemoryView":201
5665 : * else:
5666 : * info.ndim = 1
5667 : * info.shape = &self.len if flags & PyBUF_ND else NULL # <<<<<<<<<<<<<<
5668 : * info.strides = NULL
5669 : *
5670 : */
5671 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
5672 0 : if (__pyx_t_1) {
5673 : __pyx_t_5 = (&__pyx_v_self->len);
5674 : } else {
5675 : __pyx_t_5 = NULL;
5676 : }
5677 0 : __pyx_v_info->shape = __pyx_t_5;
5678 :
5679 : /* "View.MemoryView":202
5680 : * info.ndim = 1
5681 : * info.shape = &self.len if flags & PyBUF_ND else NULL
5682 : * info.strides = NULL # <<<<<<<<<<<<<<
5683 : *
5684 : * info.suboffsets = NULL
5685 : */
5686 0 : __pyx_v_info->strides = NULL;
5687 : }
5688 0 : __pyx_L6:;
5689 :
5690 : /* "View.MemoryView":204
5691 : * info.strides = NULL
5692 : *
5693 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
5694 : * info.itemsize = self.itemsize
5695 : * info.readonly = 0
5696 : */
5697 0 : __pyx_v_info->suboffsets = NULL;
5698 :
5699 : /* "View.MemoryView":205
5700 : *
5701 : * info.suboffsets = NULL
5702 : * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
5703 : * info.readonly = 0
5704 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5705 : */
5706 0 : __pyx_t_3 = __pyx_v_self->itemsize;
5707 0 : __pyx_v_info->itemsize = __pyx_t_3;
5708 :
5709 : /* "View.MemoryView":206
5710 : * info.suboffsets = NULL
5711 : * info.itemsize = self.itemsize
5712 : * info.readonly = 0 # <<<<<<<<<<<<<<
5713 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5714 : * info.obj = self
5715 : */
5716 0 : __pyx_v_info->readonly = 0;
5717 :
5718 : /* "View.MemoryView":207
5719 : * info.itemsize = self.itemsize
5720 : * info.readonly = 0
5721 : * info.format = self.format if flags & PyBUF_FORMAT else NULL # <<<<<<<<<<<<<<
5722 : * info.obj = self
5723 : *
5724 : */
5725 0 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
5726 0 : if (__pyx_t_1) {
5727 0 : __pyx_t_2 = __pyx_v_self->format;
5728 : } else {
5729 : __pyx_t_2 = NULL;
5730 : }
5731 0 : __pyx_v_info->format = __pyx_t_2;
5732 :
5733 : /* "View.MemoryView":208
5734 : * info.readonly = 0
5735 : * info.format = self.format if flags & PyBUF_FORMAT else NULL
5736 : * info.obj = self # <<<<<<<<<<<<<<
5737 : *
5738 : * def __dealloc__(array self):
5739 : */
5740 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
5741 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5742 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5743 0 : __Pyx_DECREF(__pyx_v_info->obj);
5744 0 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5745 :
5746 : /* "View.MemoryView":182
5747 : * _allocate_buffer(self)
5748 : *
5749 : * @cname('getbuffer') # <<<<<<<<<<<<<<
5750 : * def __getbuffer__(self, Py_buffer *info, int flags):
5751 : * cdef int bufmode = -1
5752 : */
5753 :
5754 : /* function exit code */
5755 0 : __pyx_r = 0;
5756 0 : goto __pyx_L0;
5757 0 : __pyx_L1_error:;
5758 0 : __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5759 0 : __pyx_r = -1;
5760 0 : if (__pyx_v_info->obj != NULL) {
5761 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5762 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5763 : }
5764 0 : goto __pyx_L2;
5765 0 : __pyx_L0:;
5766 0 : if (__pyx_v_info->obj == Py_None) {
5767 0 : __Pyx_GOTREF(__pyx_v_info->obj);
5768 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
5769 : }
5770 0 : __pyx_L2:;
5771 : __Pyx_RefNannyFinishContext();
5772 : return __pyx_r;
5773 : }
5774 :
5775 : /* "View.MemoryView":210
5776 : * info.obj = self
5777 : *
5778 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
5779 : * if self.callback_free_data != NULL:
5780 : * self.callback_free_data(self.data)
5781 : */
5782 :
5783 : /* Python wrapper */
5784 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
5785 0 : static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
5786 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5787 : __Pyx_RefNannyDeclarations
5788 0 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5789 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5790 0 : __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
5791 :
5792 : /* function exit code */
5793 0 : __Pyx_RefNannyFinishContext();
5794 : }
5795 :
5796 0 : static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
5797 0 : int __pyx_t_1;
5798 0 : int __pyx_t_2;
5799 :
5800 : /* "View.MemoryView":211
5801 : *
5802 : * def __dealloc__(array self):
5803 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5804 : * self.callback_free_data(self.data)
5805 : * elif self.free_data and self.data is not NULL:
5806 : */
5807 0 : __pyx_t_1 = (__pyx_v_self->callback_free_data != NULL);
5808 0 : if (__pyx_t_1) {
5809 :
5810 : /* "View.MemoryView":212
5811 : * def __dealloc__(array self):
5812 : * if self.callback_free_data != NULL:
5813 : * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
5814 : * elif self.free_data and self.data is not NULL:
5815 : * if self.dtype_is_object:
5816 : */
5817 0 : __pyx_v_self->callback_free_data(__pyx_v_self->data);
5818 :
5819 : /* "View.MemoryView":211
5820 : *
5821 : * def __dealloc__(array self):
5822 : * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
5823 : * self.callback_free_data(self.data)
5824 : * elif self.free_data and self.data is not NULL:
5825 : */
5826 0 : goto __pyx_L3;
5827 : }
5828 :
5829 : /* "View.MemoryView":213
5830 : * if self.callback_free_data != NULL:
5831 : * self.callback_free_data(self.data)
5832 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5833 : * if self.dtype_is_object:
5834 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5835 : */
5836 0 : if (__pyx_v_self->free_data) {
5837 0 : } else {
5838 0 : __pyx_t_1 = __pyx_v_self->free_data;
5839 0 : goto __pyx_L4_bool_binop_done;
5840 : }
5841 0 : __pyx_t_2 = (__pyx_v_self->data != NULL);
5842 0 : __pyx_t_1 = __pyx_t_2;
5843 0 : __pyx_L4_bool_binop_done:;
5844 0 : if (__pyx_t_1) {
5845 :
5846 : /* "View.MemoryView":214
5847 : * self.callback_free_data(self.data)
5848 : * elif self.free_data and self.data is not NULL:
5849 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
5850 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5851 : * free(self.data)
5852 : */
5853 0 : if (__pyx_v_self->dtype_is_object) {
5854 :
5855 : /* "View.MemoryView":215
5856 : * elif self.free_data and self.data is not NULL:
5857 : * if self.dtype_is_object:
5858 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False) # <<<<<<<<<<<<<<
5859 : * free(self.data)
5860 : * PyObject_Free(self._shape)
5861 : */
5862 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
5863 :
5864 : /* "View.MemoryView":214
5865 : * self.callback_free_data(self.data)
5866 : * elif self.free_data and self.data is not NULL:
5867 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
5868 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5869 : * free(self.data)
5870 : */
5871 : }
5872 :
5873 : /* "View.MemoryView":216
5874 : * if self.dtype_is_object:
5875 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5876 : * free(self.data) # <<<<<<<<<<<<<<
5877 : * PyObject_Free(self._shape)
5878 : *
5879 : */
5880 0 : free(__pyx_v_self->data);
5881 :
5882 : /* "View.MemoryView":213
5883 : * if self.callback_free_data != NULL:
5884 : * self.callback_free_data(self.data)
5885 : * elif self.free_data and self.data is not NULL: # <<<<<<<<<<<<<<
5886 : * if self.dtype_is_object:
5887 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5888 : */
5889 : }
5890 0 : __pyx_L3:;
5891 :
5892 : /* "View.MemoryView":217
5893 : * refcount_objects_in_slice(self.data, self._shape, self._strides, self.ndim, inc=False)
5894 : * free(self.data)
5895 : * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
5896 : *
5897 : * @property
5898 : */
5899 0 : PyObject_Free(__pyx_v_self->_shape);
5900 :
5901 : /* "View.MemoryView":210
5902 : * info.obj = self
5903 : *
5904 : * def __dealloc__(array self): # <<<<<<<<<<<<<<
5905 : * if self.callback_free_data != NULL:
5906 : * self.callback_free_data(self.data)
5907 : */
5908 :
5909 : /* function exit code */
5910 0 : }
5911 :
5912 : /* "View.MemoryView":219
5913 : * PyObject_Free(self._shape)
5914 : *
5915 : * @property # <<<<<<<<<<<<<<
5916 : * def memview(self):
5917 : * return self.get_memview()
5918 : */
5919 :
5920 : /* Python wrapper */
5921 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
5922 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
5923 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
5924 0 : PyObject *__pyx_r = 0;
5925 : __Pyx_RefNannyDeclarations
5926 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5927 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
5928 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
5929 :
5930 : /* function exit code */
5931 0 : __Pyx_RefNannyFinishContext();
5932 0 : return __pyx_r;
5933 : }
5934 :
5935 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
5936 0 : PyObject *__pyx_r = NULL;
5937 : __Pyx_RefNannyDeclarations
5938 0 : PyObject *__pyx_t_1 = NULL;
5939 0 : int __pyx_lineno = 0;
5940 0 : const char *__pyx_filename = NULL;
5941 0 : int __pyx_clineno = 0;
5942 0 : __Pyx_RefNannySetupContext("__get__", 1);
5943 :
5944 : /* "View.MemoryView":221
5945 : * @property
5946 : * def memview(self):
5947 : * return self.get_memview() # <<<<<<<<<<<<<<
5948 : *
5949 : * @cname('get_memview')
5950 : */
5951 0 : __Pyx_XDECREF(__pyx_r);
5952 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
5953 0 : __Pyx_GOTREF(__pyx_t_1);
5954 0 : __pyx_r = __pyx_t_1;
5955 0 : __pyx_t_1 = 0;
5956 0 : goto __pyx_L0;
5957 :
5958 : /* "View.MemoryView":219
5959 : * PyObject_Free(self._shape)
5960 : *
5961 : * @property # <<<<<<<<<<<<<<
5962 : * def memview(self):
5963 : * return self.get_memview()
5964 : */
5965 :
5966 : /* function exit code */
5967 0 : __pyx_L1_error:;
5968 0 : __Pyx_XDECREF(__pyx_t_1);
5969 0 : __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5970 0 : __pyx_r = NULL;
5971 0 : __pyx_L0:;
5972 0 : __Pyx_XGIVEREF(__pyx_r);
5973 0 : __Pyx_RefNannyFinishContext();
5974 0 : return __pyx_r;
5975 : }
5976 :
5977 : /* "View.MemoryView":224
5978 : *
5979 : * @cname('get_memview')
5980 : * cdef get_memview(self): # <<<<<<<<<<<<<<
5981 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
5982 : * return memoryview(self, flags, self.dtype_is_object)
5983 : */
5984 :
5985 0 : static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
5986 0 : int __pyx_v_flags;
5987 0 : PyObject *__pyx_r = NULL;
5988 : __Pyx_RefNannyDeclarations
5989 0 : PyObject *__pyx_t_1 = NULL;
5990 0 : PyObject *__pyx_t_2 = NULL;
5991 0 : PyObject *__pyx_t_3 = NULL;
5992 0 : int __pyx_lineno = 0;
5993 0 : const char *__pyx_filename = NULL;
5994 0 : int __pyx_clineno = 0;
5995 0 : __Pyx_RefNannySetupContext("get_memview", 1);
5996 :
5997 : /* "View.MemoryView":225
5998 : * @cname('get_memview')
5999 : * cdef get_memview(self):
6000 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
6001 : * return memoryview(self, flags, self.dtype_is_object)
6002 : *
6003 : */
6004 0 : __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
6005 :
6006 : /* "View.MemoryView":226
6007 : * cdef get_memview(self):
6008 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6009 : * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
6010 : *
6011 : * def __len__(self):
6012 : */
6013 0 : __Pyx_XDECREF(__pyx_r);
6014 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error)
6015 0 : __Pyx_GOTREF(__pyx_t_1);
6016 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6017 0 : __Pyx_GOTREF(__pyx_t_2);
6018 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __pyx_L1_error)
6019 0 : __Pyx_GOTREF(__pyx_t_3);
6020 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
6021 0 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
6022 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self))) __PYX_ERR(1, 226, __pyx_L1_error);
6023 0 : __Pyx_GIVEREF(__pyx_t_1);
6024 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 226, __pyx_L1_error);
6025 0 : __Pyx_GIVEREF(__pyx_t_2);
6026 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error);
6027 0 : __pyx_t_1 = 0;
6028 0 : __pyx_t_2 = 0;
6029 0 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
6030 0 : __Pyx_GOTREF(__pyx_t_2);
6031 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6032 0 : __pyx_r = __pyx_t_2;
6033 0 : __pyx_t_2 = 0;
6034 0 : goto __pyx_L0;
6035 :
6036 : /* "View.MemoryView":224
6037 : *
6038 : * @cname('get_memview')
6039 : * cdef get_memview(self): # <<<<<<<<<<<<<<
6040 : * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
6041 : * return memoryview(self, flags, self.dtype_is_object)
6042 : */
6043 :
6044 : /* function exit code */
6045 0 : __pyx_L1_error:;
6046 0 : __Pyx_XDECREF(__pyx_t_1);
6047 0 : __Pyx_XDECREF(__pyx_t_2);
6048 0 : __Pyx_XDECREF(__pyx_t_3);
6049 0 : __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
6050 0 : __pyx_r = 0;
6051 0 : __pyx_L0:;
6052 0 : __Pyx_XGIVEREF(__pyx_r);
6053 0 : __Pyx_RefNannyFinishContext();
6054 0 : return __pyx_r;
6055 : }
6056 :
6057 : /* "View.MemoryView":228
6058 : * return memoryview(self, flags, self.dtype_is_object)
6059 : *
6060 : * def __len__(self): # <<<<<<<<<<<<<<
6061 : * return self._shape[0]
6062 : *
6063 : */
6064 :
6065 : /* Python wrapper */
6066 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
6067 0 : static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
6068 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6069 0 : Py_ssize_t __pyx_r;
6070 : __Pyx_RefNannyDeclarations
6071 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
6072 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6073 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
6074 :
6075 : /* function exit code */
6076 0 : __Pyx_RefNannyFinishContext();
6077 0 : return __pyx_r;
6078 : }
6079 :
6080 0 : static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
6081 0 : Py_ssize_t __pyx_r;
6082 :
6083 : /* "View.MemoryView":229
6084 : *
6085 : * def __len__(self):
6086 : * return self._shape[0] # <<<<<<<<<<<<<<
6087 : *
6088 : * def __getattr__(self, attr):
6089 : */
6090 0 : __pyx_r = (__pyx_v_self->_shape[0]);
6091 0 : goto __pyx_L0;
6092 :
6093 : /* "View.MemoryView":228
6094 : * return memoryview(self, flags, self.dtype_is_object)
6095 : *
6096 : * def __len__(self): # <<<<<<<<<<<<<<
6097 : * return self._shape[0]
6098 : *
6099 : */
6100 :
6101 : /* function exit code */
6102 0 : __pyx_L0:;
6103 0 : return __pyx_r;
6104 : }
6105 :
6106 : /* "View.MemoryView":231
6107 : * return self._shape[0]
6108 : *
6109 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6110 : * return getattr(self.memview, attr)
6111 : *
6112 : */
6113 :
6114 : /* Python wrapper */
6115 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
6116 0 : static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
6117 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6118 0 : PyObject *__pyx_r = 0;
6119 : __Pyx_RefNannyDeclarations
6120 0 : __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
6121 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6122 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
6123 :
6124 : /* function exit code */
6125 0 : __Pyx_RefNannyFinishContext();
6126 0 : return __pyx_r;
6127 : }
6128 :
6129 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
6130 0 : PyObject *__pyx_r = NULL;
6131 : __Pyx_RefNannyDeclarations
6132 0 : PyObject *__pyx_t_1 = NULL;
6133 0 : PyObject *__pyx_t_2 = NULL;
6134 0 : int __pyx_lineno = 0;
6135 0 : const char *__pyx_filename = NULL;
6136 0 : int __pyx_clineno = 0;
6137 0 : __Pyx_RefNannySetupContext("__getattr__", 1);
6138 :
6139 : /* "View.MemoryView":232
6140 : *
6141 : * def __getattr__(self, attr):
6142 : * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
6143 : *
6144 : * def __getitem__(self, item):
6145 : */
6146 0 : __Pyx_XDECREF(__pyx_r);
6147 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 232, __pyx_L1_error)
6148 0 : __Pyx_GOTREF(__pyx_t_1);
6149 0 : __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 232, __pyx_L1_error)
6150 0 : __Pyx_GOTREF(__pyx_t_2);
6151 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6152 0 : __pyx_r = __pyx_t_2;
6153 0 : __pyx_t_2 = 0;
6154 0 : goto __pyx_L0;
6155 :
6156 : /* "View.MemoryView":231
6157 : * return self._shape[0]
6158 : *
6159 : * def __getattr__(self, attr): # <<<<<<<<<<<<<<
6160 : * return getattr(self.memview, attr)
6161 : *
6162 : */
6163 :
6164 : /* function exit code */
6165 0 : __pyx_L1_error:;
6166 0 : __Pyx_XDECREF(__pyx_t_1);
6167 0 : __Pyx_XDECREF(__pyx_t_2);
6168 0 : __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6169 0 : __pyx_r = NULL;
6170 0 : __pyx_L0:;
6171 0 : __Pyx_XGIVEREF(__pyx_r);
6172 0 : __Pyx_RefNannyFinishContext();
6173 0 : return __pyx_r;
6174 : }
6175 :
6176 : /* "View.MemoryView":234
6177 : * return getattr(self.memview, attr)
6178 : *
6179 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6180 : * return self.memview[item]
6181 : *
6182 : */
6183 :
6184 : /* Python wrapper */
6185 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
6186 0 : static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
6187 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6188 0 : PyObject *__pyx_r = 0;
6189 : __Pyx_RefNannyDeclarations
6190 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
6191 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6192 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
6193 :
6194 : /* function exit code */
6195 0 : __Pyx_RefNannyFinishContext();
6196 0 : return __pyx_r;
6197 : }
6198 :
6199 0 : static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
6200 0 : PyObject *__pyx_r = NULL;
6201 : __Pyx_RefNannyDeclarations
6202 0 : PyObject *__pyx_t_1 = NULL;
6203 0 : PyObject *__pyx_t_2 = NULL;
6204 0 : int __pyx_lineno = 0;
6205 0 : const char *__pyx_filename = NULL;
6206 0 : int __pyx_clineno = 0;
6207 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
6208 :
6209 : /* "View.MemoryView":235
6210 : *
6211 : * def __getitem__(self, item):
6212 : * return self.memview[item] # <<<<<<<<<<<<<<
6213 : *
6214 : * def __setitem__(self, item, value):
6215 : */
6216 0 : __Pyx_XDECREF(__pyx_r);
6217 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 235, __pyx_L1_error)
6218 0 : __Pyx_GOTREF(__pyx_t_1);
6219 0 : __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 235, __pyx_L1_error)
6220 0 : __Pyx_GOTREF(__pyx_t_2);
6221 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6222 0 : __pyx_r = __pyx_t_2;
6223 0 : __pyx_t_2 = 0;
6224 0 : goto __pyx_L0;
6225 :
6226 : /* "View.MemoryView":234
6227 : * return getattr(self.memview, attr)
6228 : *
6229 : * def __getitem__(self, item): # <<<<<<<<<<<<<<
6230 : * return self.memview[item]
6231 : *
6232 : */
6233 :
6234 : /* function exit code */
6235 0 : __pyx_L1_error:;
6236 0 : __Pyx_XDECREF(__pyx_t_1);
6237 0 : __Pyx_XDECREF(__pyx_t_2);
6238 0 : __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6239 0 : __pyx_r = NULL;
6240 0 : __pyx_L0:;
6241 0 : __Pyx_XGIVEREF(__pyx_r);
6242 0 : __Pyx_RefNannyFinishContext();
6243 0 : return __pyx_r;
6244 : }
6245 :
6246 : /* "View.MemoryView":237
6247 : * return self.memview[item]
6248 : *
6249 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6250 : * self.memview[item] = value
6251 : *
6252 : */
6253 :
6254 : /* Python wrapper */
6255 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
6256 0 : static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6257 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6258 0 : int __pyx_r;
6259 : __Pyx_RefNannyDeclarations
6260 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
6261 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6262 0 : __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
6263 :
6264 : /* function exit code */
6265 0 : __Pyx_RefNannyFinishContext();
6266 0 : return __pyx_r;
6267 : }
6268 :
6269 0 : static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
6270 0 : int __pyx_r;
6271 : __Pyx_RefNannyDeclarations
6272 0 : PyObject *__pyx_t_1 = NULL;
6273 0 : int __pyx_lineno = 0;
6274 0 : const char *__pyx_filename = NULL;
6275 0 : int __pyx_clineno = 0;
6276 0 : __Pyx_RefNannySetupContext("__setitem__", 1);
6277 :
6278 : /* "View.MemoryView":238
6279 : *
6280 : * def __setitem__(self, item, value):
6281 : * self.memview[item] = value # <<<<<<<<<<<<<<
6282 : *
6283 : *
6284 : */
6285 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 238, __pyx_L1_error)
6286 0 : __Pyx_GOTREF(__pyx_t_1);
6287 0 : if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0))) __PYX_ERR(1, 238, __pyx_L1_error)
6288 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6289 :
6290 : /* "View.MemoryView":237
6291 : * return self.memview[item]
6292 : *
6293 : * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
6294 : * self.memview[item] = value
6295 : *
6296 : */
6297 :
6298 : /* function exit code */
6299 0 : __pyx_r = 0;
6300 0 : goto __pyx_L0;
6301 0 : __pyx_L1_error:;
6302 0 : __Pyx_XDECREF(__pyx_t_1);
6303 0 : __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6304 0 : __pyx_r = -1;
6305 0 : __pyx_L0:;
6306 0 : __Pyx_RefNannyFinishContext();
6307 0 : return __pyx_r;
6308 : }
6309 :
6310 : /* "(tree fragment)":1
6311 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6312 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6313 : * def __setstate_cython__(self, __pyx_state):
6314 : */
6315 :
6316 : /* Python wrapper */
6317 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6318 : #if CYTHON_METH_FASTCALL
6319 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6320 : #else
6321 : PyObject *__pyx_args, PyObject *__pyx_kwds
6322 : #endif
6323 : ); /*proto*/
6324 0 : static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self,
6325 : #if CYTHON_METH_FASTCALL
6326 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6327 : #else
6328 : PyObject *__pyx_args, PyObject *__pyx_kwds
6329 : #endif
6330 : ) {
6331 : #if !CYTHON_METH_FASTCALL
6332 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6333 : #endif
6334 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6335 0 : PyObject *__pyx_r = 0;
6336 : __Pyx_RefNannyDeclarations
6337 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6338 : #if !CYTHON_METH_FASTCALL
6339 : #if CYTHON_ASSUME_SAFE_MACROS
6340 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6341 : #else
6342 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6343 : #endif
6344 : #endif
6345 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6346 0 : if (unlikely(__pyx_nargs > 0)) {
6347 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
6348 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
6349 0 : __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
6350 :
6351 : /* function exit code */
6352 0 : __Pyx_RefNannyFinishContext();
6353 0 : return __pyx_r;
6354 : }
6355 :
6356 0 : static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
6357 0 : PyObject *__pyx_r = NULL;
6358 : __Pyx_RefNannyDeclarations
6359 0 : int __pyx_lineno = 0;
6360 0 : const char *__pyx_filename = NULL;
6361 0 : int __pyx_clineno = 0;
6362 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
6363 :
6364 : /* "(tree fragment)":2
6365 : * def __reduce_cython__(self):
6366 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6367 : * def __setstate_cython__(self, __pyx_state):
6368 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6369 : */
6370 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
6371 0 : __PYX_ERR(1, 2, __pyx_L1_error)
6372 :
6373 : /* "(tree fragment)":1
6374 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6375 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6376 : * def __setstate_cython__(self, __pyx_state):
6377 : */
6378 :
6379 : /* function exit code */
6380 0 : __pyx_L1_error:;
6381 0 : __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6382 0 : __pyx_r = NULL;
6383 0 : __Pyx_XGIVEREF(__pyx_r);
6384 0 : __Pyx_RefNannyFinishContext();
6385 0 : return __pyx_r;
6386 : }
6387 :
6388 : /* "(tree fragment)":3
6389 : * def __reduce_cython__(self):
6390 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6391 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6392 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6393 : */
6394 :
6395 : /* Python wrapper */
6396 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6397 : #if CYTHON_METH_FASTCALL
6398 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6399 : #else
6400 : PyObject *__pyx_args, PyObject *__pyx_kwds
6401 : #endif
6402 : ); /*proto*/
6403 0 : static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self,
6404 : #if CYTHON_METH_FASTCALL
6405 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
6406 : #else
6407 : PyObject *__pyx_args, PyObject *__pyx_kwds
6408 : #endif
6409 : ) {
6410 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
6411 : #if !CYTHON_METH_FASTCALL
6412 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6413 : #endif
6414 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6415 0 : PyObject* values[1] = {0};
6416 0 : int __pyx_lineno = 0;
6417 0 : const char *__pyx_filename = NULL;
6418 0 : int __pyx_clineno = 0;
6419 0 : PyObject *__pyx_r = 0;
6420 : __Pyx_RefNannyDeclarations
6421 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6422 : #if !CYTHON_METH_FASTCALL
6423 : #if CYTHON_ASSUME_SAFE_MACROS
6424 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6425 : #else
6426 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
6427 : #endif
6428 : #endif
6429 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
6430 : {
6431 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
6432 0 : if (__pyx_kwds) {
6433 0 : Py_ssize_t kw_args;
6434 0 : switch (__pyx_nargs) {
6435 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
6436 0 : CYTHON_FALLTHROUGH;
6437 0 : case 0: break;
6438 0 : default: goto __pyx_L5_argtuple_error;
6439 : }
6440 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
6441 0 : switch (__pyx_nargs) {
6442 : case 0:
6443 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
6444 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
6445 0 : kw_args--;
6446 : }
6447 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
6448 0 : else goto __pyx_L5_argtuple_error;
6449 : }
6450 0 : if (unlikely(kw_args > 0)) {
6451 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
6452 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
6453 : }
6454 0 : } else if (unlikely(__pyx_nargs != 1)) {
6455 0 : goto __pyx_L5_argtuple_error;
6456 : } else {
6457 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
6458 : }
6459 0 : __pyx_v___pyx_state = values[0];
6460 : }
6461 0 : goto __pyx_L6_skip;
6462 0 : __pyx_L5_argtuple_error:;
6463 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
6464 0 : __pyx_L6_skip:;
6465 0 : goto __pyx_L4_argument_unpacking_done;
6466 0 : __pyx_L3_error:;
6467 : {
6468 0 : Py_ssize_t __pyx_temp;
6469 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6470 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
6471 : }
6472 : }
6473 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6474 0 : __Pyx_RefNannyFinishContext();
6475 0 : return NULL;
6476 0 : __pyx_L4_argument_unpacking_done:;
6477 0 : __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v___pyx_state);
6478 :
6479 : /* function exit code */
6480 : {
6481 0 : Py_ssize_t __pyx_temp;
6482 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6483 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
6484 : }
6485 : }
6486 : __Pyx_RefNannyFinishContext();
6487 : return __pyx_r;
6488 : }
6489 :
6490 0 : static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6491 0 : PyObject *__pyx_r = NULL;
6492 : __Pyx_RefNannyDeclarations
6493 0 : int __pyx_lineno = 0;
6494 0 : const char *__pyx_filename = NULL;
6495 0 : int __pyx_clineno = 0;
6496 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
6497 :
6498 : /* "(tree fragment)":4
6499 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6500 : * def __setstate_cython__(self, __pyx_state):
6501 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
6502 : */
6503 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
6504 0 : __PYX_ERR(1, 4, __pyx_L1_error)
6505 :
6506 : /* "(tree fragment)":3
6507 : * def __reduce_cython__(self):
6508 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6509 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6510 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
6511 : */
6512 :
6513 : /* function exit code */
6514 0 : __pyx_L1_error:;
6515 0 : __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6516 0 : __pyx_r = NULL;
6517 0 : __Pyx_XGIVEREF(__pyx_r);
6518 0 : __Pyx_RefNannyFinishContext();
6519 0 : return __pyx_r;
6520 : }
6521 :
6522 : /* "View.MemoryView":248
6523 : *
6524 : * @cname("__pyx_array_allocate_buffer")
6525 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
6526 : *
6527 : *
6528 : */
6529 :
6530 0 : static int __pyx_array_allocate_buffer(struct __pyx_array_obj *__pyx_v_self) {
6531 0 : Py_ssize_t __pyx_v_i;
6532 0 : PyObject **__pyx_v_p;
6533 0 : int __pyx_r;
6534 0 : int __pyx_t_1;
6535 0 : Py_ssize_t __pyx_t_2;
6536 0 : Py_ssize_t __pyx_t_3;
6537 0 : Py_ssize_t __pyx_t_4;
6538 0 : int __pyx_lineno = 0;
6539 0 : const char *__pyx_filename = NULL;
6540 0 : int __pyx_clineno = 0;
6541 :
6542 : /* "View.MemoryView":254
6543 : * cdef PyObject **p
6544 : *
6545 : * self.free_data = True # <<<<<<<<<<<<<<
6546 : * self.data = <char *>malloc(self.len)
6547 : * if not self.data:
6548 : */
6549 0 : __pyx_v_self->free_data = 1;
6550 :
6551 : /* "View.MemoryView":255
6552 : *
6553 : * self.free_data = True
6554 : * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
6555 : * if not self.data:
6556 : * raise MemoryError, "unable to allocate array data."
6557 : */
6558 0 : __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
6559 :
6560 : /* "View.MemoryView":256
6561 : * self.free_data = True
6562 : * self.data = <char *>malloc(self.len)
6563 : * if not self.data: # <<<<<<<<<<<<<<
6564 : * raise MemoryError, "unable to allocate array data."
6565 : *
6566 : */
6567 0 : __pyx_t_1 = (!(__pyx_v_self->data != 0));
6568 0 : if (unlikely(__pyx_t_1)) {
6569 :
6570 : /* "View.MemoryView":257
6571 : * self.data = <char *>malloc(self.len)
6572 : * if not self.data:
6573 : * raise MemoryError, "unable to allocate array data." # <<<<<<<<<<<<<<
6574 : *
6575 : * if self.dtype_is_object:
6576 : */
6577 0 : __Pyx_Raise(__pyx_builtin_MemoryError, __pyx_kp_s_unable_to_allocate_array_data, 0, 0);
6578 0 : __PYX_ERR(1, 257, __pyx_L1_error)
6579 :
6580 : /* "View.MemoryView":256
6581 : * self.free_data = True
6582 : * self.data = <char *>malloc(self.len)
6583 : * if not self.data: # <<<<<<<<<<<<<<
6584 : * raise MemoryError, "unable to allocate array data."
6585 : *
6586 : */
6587 : }
6588 :
6589 : /* "View.MemoryView":259
6590 : * raise MemoryError, "unable to allocate array data."
6591 : *
6592 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6593 : * p = <PyObject **> self.data
6594 : * for i in range(self.len // self.itemsize):
6595 : */
6596 0 : if (__pyx_v_self->dtype_is_object) {
6597 :
6598 : /* "View.MemoryView":260
6599 : *
6600 : * if self.dtype_is_object:
6601 : * p = <PyObject **> self.data # <<<<<<<<<<<<<<
6602 : * for i in range(self.len // self.itemsize):
6603 : * p[i] = Py_None
6604 : */
6605 0 : __pyx_v_p = ((PyObject **)__pyx_v_self->data);
6606 :
6607 : /* "View.MemoryView":261
6608 : * if self.dtype_is_object:
6609 : * p = <PyObject **> self.data
6610 : * for i in range(self.len // self.itemsize): # <<<<<<<<<<<<<<
6611 : * p[i] = Py_None
6612 : * Py_INCREF(Py_None)
6613 : */
6614 0 : if (unlikely(__pyx_v_self->itemsize == 0)) {
6615 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6616 0 : __PYX_ERR(1, 261, __pyx_L1_error)
6617 : }
6618 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_self->itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
6619 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
6620 0 : __PYX_ERR(1, 261, __pyx_L1_error)
6621 : }
6622 0 : __pyx_t_2 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_self->itemsize);
6623 0 : __pyx_t_3 = __pyx_t_2;
6624 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6625 0 : __pyx_v_i = __pyx_t_4;
6626 :
6627 : /* "View.MemoryView":262
6628 : * p = <PyObject **> self.data
6629 : * for i in range(self.len // self.itemsize):
6630 : * p[i] = Py_None # <<<<<<<<<<<<<<
6631 : * Py_INCREF(Py_None)
6632 : * return 0
6633 : */
6634 0 : (__pyx_v_p[__pyx_v_i]) = Py_None;
6635 :
6636 : /* "View.MemoryView":263
6637 : * for i in range(self.len // self.itemsize):
6638 : * p[i] = Py_None
6639 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
6640 : * return 0
6641 : *
6642 : */
6643 0 : Py_INCREF(Py_None);
6644 : }
6645 :
6646 : /* "View.MemoryView":259
6647 : * raise MemoryError, "unable to allocate array data."
6648 : *
6649 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
6650 : * p = <PyObject **> self.data
6651 : * for i in range(self.len // self.itemsize):
6652 : */
6653 : }
6654 :
6655 : /* "View.MemoryView":264
6656 : * p[i] = Py_None
6657 : * Py_INCREF(Py_None)
6658 : * return 0 # <<<<<<<<<<<<<<
6659 : *
6660 : *
6661 : */
6662 0 : __pyx_r = 0;
6663 0 : goto __pyx_L0;
6664 :
6665 : /* "View.MemoryView":248
6666 : *
6667 : * @cname("__pyx_array_allocate_buffer")
6668 : * cdef int _allocate_buffer(array self) except -1: # <<<<<<<<<<<<<<
6669 : *
6670 : *
6671 : */
6672 :
6673 : /* function exit code */
6674 0 : __pyx_L1_error:;
6675 0 : __Pyx_AddTraceback("View.MemoryView._allocate_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
6676 0 : __pyx_r = -1;
6677 0 : __pyx_L0:;
6678 0 : return __pyx_r;
6679 : }
6680 :
6681 : /* "View.MemoryView":268
6682 : *
6683 : * @cname("__pyx_array_new")
6684 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
6685 : * cdef array result
6686 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6687 : */
6688 :
6689 0 : static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_c_mode, char *__pyx_v_buf) {
6690 0 : struct __pyx_array_obj *__pyx_v_result = 0;
6691 0 : PyObject *__pyx_v_mode = 0;
6692 0 : struct __pyx_array_obj *__pyx_r = NULL;
6693 : __Pyx_RefNannyDeclarations
6694 0 : PyObject *__pyx_t_1 = NULL;
6695 0 : int __pyx_t_2;
6696 0 : PyObject *__pyx_t_3 = NULL;
6697 0 : PyObject *__pyx_t_4 = NULL;
6698 0 : int __pyx_lineno = 0;
6699 0 : const char *__pyx_filename = NULL;
6700 0 : int __pyx_clineno = 0;
6701 0 : __Pyx_RefNannySetupContext("array_cwrapper", 1);
6702 :
6703 : /* "View.MemoryView":270
6704 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf):
6705 : * cdef array result
6706 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string. # <<<<<<<<<<<<<<
6707 : *
6708 : * if buf is NULL:
6709 : */
6710 0 : __pyx_t_2 = ((__pyx_v_c_mode[0]) == 'f');
6711 0 : if (__pyx_t_2) {
6712 0 : __Pyx_INCREF(__pyx_n_s_fortran);
6713 : __pyx_t_1 = __pyx_n_s_fortran;
6714 : } else {
6715 0 : __Pyx_INCREF(__pyx_n_s_c);
6716 : __pyx_t_1 = __pyx_n_s_c;
6717 : }
6718 0 : __pyx_v_mode = ((PyObject*)__pyx_t_1);
6719 0 : __pyx_t_1 = 0;
6720 :
6721 : /* "View.MemoryView":272
6722 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6723 : *
6724 : * if buf is NULL: # <<<<<<<<<<<<<<
6725 : * result = array.__new__(array, shape, itemsize, format, mode)
6726 : * else:
6727 : */
6728 0 : __pyx_t_2 = (__pyx_v_buf == NULL);
6729 0 : if (__pyx_t_2) {
6730 :
6731 : /* "View.MemoryView":273
6732 : *
6733 : * if buf is NULL:
6734 : * result = array.__new__(array, shape, itemsize, format, mode) # <<<<<<<<<<<<<<
6735 : * else:
6736 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6737 : */
6738 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
6739 0 : __Pyx_GOTREF(__pyx_t_1);
6740 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
6741 0 : __Pyx_GOTREF(__pyx_t_3);
6742 0 : __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 273, __pyx_L1_error)
6743 0 : __Pyx_GOTREF(__pyx_t_4);
6744 0 : __Pyx_INCREF(__pyx_v_shape);
6745 0 : __Pyx_GIVEREF(__pyx_v_shape);
6746 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape)) __PYX_ERR(1, 273, __pyx_L1_error);
6747 0 : __Pyx_GIVEREF(__pyx_t_1);
6748 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error);
6749 0 : __Pyx_GIVEREF(__pyx_t_3);
6750 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error);
6751 0 : __Pyx_INCREF(__pyx_v_mode);
6752 0 : __Pyx_GIVEREF(__pyx_v_mode);
6753 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_mode)) __PYX_ERR(1, 273, __pyx_L1_error);
6754 0 : __pyx_t_1 = 0;
6755 0 : __pyx_t_3 = 0;
6756 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 273, __pyx_L1_error)
6757 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
6758 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6759 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6760 0 : __pyx_t_3 = 0;
6761 :
6762 : /* "View.MemoryView":272
6763 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6764 : *
6765 : * if buf is NULL: # <<<<<<<<<<<<<<
6766 : * result = array.__new__(array, shape, itemsize, format, mode)
6767 : * else:
6768 : */
6769 0 : goto __pyx_L3;
6770 : }
6771 :
6772 : /* "View.MemoryView":275
6773 : * result = array.__new__(array, shape, itemsize, format, mode)
6774 : * else:
6775 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False) # <<<<<<<<<<<<<<
6776 : * result.data = buf
6777 : *
6778 : */
6779 : /*else*/ {
6780 0 : __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
6781 0 : __Pyx_GOTREF(__pyx_t_3);
6782 0 : __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
6783 0 : __Pyx_GOTREF(__pyx_t_4);
6784 0 : __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 275, __pyx_L1_error)
6785 0 : __Pyx_GOTREF(__pyx_t_1);
6786 0 : __Pyx_INCREF(__pyx_v_shape);
6787 0 : __Pyx_GIVEREF(__pyx_v_shape);
6788 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape)) __PYX_ERR(1, 275, __pyx_L1_error);
6789 0 : __Pyx_GIVEREF(__pyx_t_3);
6790 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error);
6791 0 : __Pyx_GIVEREF(__pyx_t_4);
6792 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error);
6793 0 : __Pyx_INCREF(__pyx_v_mode);
6794 0 : __Pyx_GIVEREF(__pyx_v_mode);
6795 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_mode)) __PYX_ERR(1, 275, __pyx_L1_error);
6796 0 : __pyx_t_3 = 0;
6797 0 : __pyx_t_4 = 0;
6798 0 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 275, __pyx_L1_error)
6799 0 : __Pyx_GOTREF(__pyx_t_4);
6800 0 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
6801 0 : __pyx_t_3 = ((PyObject *)__pyx_tp_new_array(((PyTypeObject *)__pyx_array_type), __pyx_t_1, __pyx_t_4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 275, __pyx_L1_error)
6802 0 : __Pyx_GOTREF((PyObject *)__pyx_t_3);
6803 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6804 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6805 0 : __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_3);
6806 0 : __pyx_t_3 = 0;
6807 :
6808 : /* "View.MemoryView":276
6809 : * else:
6810 : * result = array.__new__(array, shape, itemsize, format, mode, allocate_buffer=False)
6811 : * result.data = buf # <<<<<<<<<<<<<<
6812 : *
6813 : * return result
6814 : */
6815 0 : __pyx_v_result->data = __pyx_v_buf;
6816 : }
6817 0 : __pyx_L3:;
6818 :
6819 : /* "View.MemoryView":278
6820 : * result.data = buf
6821 : *
6822 : * return result # <<<<<<<<<<<<<<
6823 : *
6824 : *
6825 : */
6826 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
6827 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
6828 0 : __pyx_r = __pyx_v_result;
6829 0 : goto __pyx_L0;
6830 :
6831 : /* "View.MemoryView":268
6832 : *
6833 : * @cname("__pyx_array_new")
6834 : * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, char *c_mode, char *buf): # <<<<<<<<<<<<<<
6835 : * cdef array result
6836 : * cdef str mode = "fortran" if c_mode[0] == b'f' else "c" # this often comes from a constant C string.
6837 : */
6838 :
6839 : /* function exit code */
6840 0 : __pyx_L1_error:;
6841 0 : __Pyx_XDECREF(__pyx_t_1);
6842 0 : __Pyx_XDECREF(__pyx_t_3);
6843 0 : __Pyx_XDECREF(__pyx_t_4);
6844 0 : __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
6845 0 : __pyx_r = 0;
6846 0 : __pyx_L0:;
6847 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
6848 0 : __Pyx_XDECREF(__pyx_v_mode);
6849 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
6850 0 : __Pyx_RefNannyFinishContext();
6851 0 : return __pyx_r;
6852 : }
6853 :
6854 : /* "View.MemoryView":304
6855 : * cdef class Enum(object):
6856 : * cdef object name
6857 : * def __init__(self, name): # <<<<<<<<<<<<<<
6858 : * self.name = name
6859 : * def __repr__(self):
6860 : */
6861 :
6862 : /* Python wrapper */
6863 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6864 15 : static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6865 15 : PyObject *__pyx_v_name = 0;
6866 15 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
6867 15 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6868 15 : PyObject* values[1] = {0};
6869 15 : int __pyx_lineno = 0;
6870 15 : const char *__pyx_filename = NULL;
6871 15 : int __pyx_clineno = 0;
6872 15 : int __pyx_r;
6873 : __Pyx_RefNannyDeclarations
6874 15 : __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6875 : #if CYTHON_ASSUME_SAFE_MACROS
6876 15 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
6877 : #else
6878 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
6879 : #endif
6880 15 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6881 : {
6882 15 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
6883 15 : if (__pyx_kwds) {
6884 0 : Py_ssize_t kw_args;
6885 0 : switch (__pyx_nargs) {
6886 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
6887 0 : CYTHON_FALLTHROUGH;
6888 0 : case 0: break;
6889 0 : default: goto __pyx_L5_argtuple_error;
6890 : }
6891 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
6892 0 : switch (__pyx_nargs) {
6893 0 : case 0:
6894 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_name)) != 0)) {
6895 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
6896 0 : kw_args--;
6897 : }
6898 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 304, __pyx_L3_error)
6899 0 : else goto __pyx_L5_argtuple_error;
6900 : }
6901 0 : if (unlikely(kw_args > 0)) {
6902 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
6903 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 304, __pyx_L3_error)
6904 : }
6905 15 : } else if (unlikely(__pyx_nargs != 1)) {
6906 0 : goto __pyx_L5_argtuple_error;
6907 : } else {
6908 15 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
6909 : }
6910 15 : __pyx_v_name = values[0];
6911 : }
6912 15 : goto __pyx_L6_skip;
6913 0 : __pyx_L5_argtuple_error:;
6914 0 : __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 304, __pyx_L3_error)
6915 15 : __pyx_L6_skip:;
6916 15 : goto __pyx_L4_argument_unpacking_done;
6917 0 : __pyx_L3_error:;
6918 : {
6919 0 : Py_ssize_t __pyx_temp;
6920 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6921 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
6922 : }
6923 : }
6924 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6925 0 : __Pyx_RefNannyFinishContext();
6926 0 : return -1;
6927 15 : __pyx_L4_argument_unpacking_done:;
6928 15 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
6929 :
6930 : /* function exit code */
6931 : {
6932 15 : Py_ssize_t __pyx_temp;
6933 15 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
6934 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
6935 : }
6936 : }
6937 : __Pyx_RefNannyFinishContext();
6938 : return __pyx_r;
6939 : }
6940 :
6941 15 : static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
6942 15 : int __pyx_r;
6943 : __Pyx_RefNannyDeclarations
6944 15 : __Pyx_RefNannySetupContext("__init__", 1);
6945 :
6946 : /* "View.MemoryView":305
6947 : * cdef object name
6948 : * def __init__(self, name):
6949 : * self.name = name # <<<<<<<<<<<<<<
6950 : * def __repr__(self):
6951 : * return self.name
6952 : */
6953 15 : __Pyx_INCREF(__pyx_v_name);
6954 15 : __Pyx_GIVEREF(__pyx_v_name);
6955 15 : __Pyx_GOTREF(__pyx_v_self->name);
6956 15 : __Pyx_DECREF(__pyx_v_self->name);
6957 15 : __pyx_v_self->name = __pyx_v_name;
6958 :
6959 : /* "View.MemoryView":304
6960 : * cdef class Enum(object):
6961 : * cdef object name
6962 : * def __init__(self, name): # <<<<<<<<<<<<<<
6963 : * self.name = name
6964 : * def __repr__(self):
6965 : */
6966 :
6967 : /* function exit code */
6968 15 : __pyx_r = 0;
6969 15 : __Pyx_RefNannyFinishContext();
6970 15 : return __pyx_r;
6971 : }
6972 :
6973 : /* "View.MemoryView":306
6974 : * def __init__(self, name):
6975 : * self.name = name
6976 : * def __repr__(self): # <<<<<<<<<<<<<<
6977 : * return self.name
6978 : *
6979 : */
6980 :
6981 : /* Python wrapper */
6982 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
6983 0 : static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
6984 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
6985 0 : PyObject *__pyx_r = 0;
6986 : __Pyx_RefNannyDeclarations
6987 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
6988 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6989 0 : __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
6990 :
6991 : /* function exit code */
6992 0 : __Pyx_RefNannyFinishContext();
6993 0 : return __pyx_r;
6994 : }
6995 :
6996 0 : static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
6997 0 : PyObject *__pyx_r = NULL;
6998 : __Pyx_RefNannyDeclarations
6999 0 : __Pyx_RefNannySetupContext("__repr__", 1);
7000 :
7001 : /* "View.MemoryView":307
7002 : * self.name = name
7003 : * def __repr__(self):
7004 : * return self.name # <<<<<<<<<<<<<<
7005 : *
7006 : * cdef generic = Enum("<strided and direct or indirect>")
7007 : */
7008 0 : __Pyx_XDECREF(__pyx_r);
7009 0 : __Pyx_INCREF(__pyx_v_self->name);
7010 0 : __pyx_r = __pyx_v_self->name;
7011 0 : goto __pyx_L0;
7012 :
7013 : /* "View.MemoryView":306
7014 : * def __init__(self, name):
7015 : * self.name = name
7016 : * def __repr__(self): # <<<<<<<<<<<<<<
7017 : * return self.name
7018 : *
7019 : */
7020 :
7021 : /* function exit code */
7022 0 : __pyx_L0:;
7023 0 : __Pyx_XGIVEREF(__pyx_r);
7024 0 : __Pyx_RefNannyFinishContext();
7025 0 : return __pyx_r;
7026 : }
7027 :
7028 : /* "(tree fragment)":1
7029 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7030 : * cdef tuple state
7031 : * cdef object _dict
7032 : */
7033 :
7034 : /* Python wrapper */
7035 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7036 : #if CYTHON_METH_FASTCALL
7037 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7038 : #else
7039 : PyObject *__pyx_args, PyObject *__pyx_kwds
7040 : #endif
7041 : ); /*proto*/
7042 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self,
7043 : #if CYTHON_METH_FASTCALL
7044 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7045 : #else
7046 : PyObject *__pyx_args, PyObject *__pyx_kwds
7047 : #endif
7048 : ) {
7049 : #if !CYTHON_METH_FASTCALL
7050 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7051 : #endif
7052 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7053 0 : PyObject *__pyx_r = 0;
7054 : __Pyx_RefNannyDeclarations
7055 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7056 : #if !CYTHON_METH_FASTCALL
7057 : #if CYTHON_ASSUME_SAFE_MACROS
7058 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7059 : #else
7060 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7061 : #endif
7062 : #endif
7063 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7064 0 : if (unlikely(__pyx_nargs > 0)) {
7065 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
7066 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
7067 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
7068 :
7069 : /* function exit code */
7070 0 : __Pyx_RefNannyFinishContext();
7071 0 : return __pyx_r;
7072 : }
7073 :
7074 0 : static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
7075 0 : PyObject *__pyx_v_state = 0;
7076 0 : PyObject *__pyx_v__dict = 0;
7077 0 : int __pyx_v_use_setstate;
7078 0 : PyObject *__pyx_r = NULL;
7079 : __Pyx_RefNannyDeclarations
7080 0 : PyObject *__pyx_t_1 = NULL;
7081 0 : int __pyx_t_2;
7082 0 : PyObject *__pyx_t_3 = NULL;
7083 0 : PyObject *__pyx_t_4 = NULL;
7084 0 : int __pyx_lineno = 0;
7085 0 : const char *__pyx_filename = NULL;
7086 0 : int __pyx_clineno = 0;
7087 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
7088 :
7089 : /* "(tree fragment)":5
7090 : * cdef object _dict
7091 : * cdef bint use_setstate
7092 : * state = (self.name,) # <<<<<<<<<<<<<<
7093 : * _dict = getattr(self, '__dict__', None)
7094 : * if _dict is not None:
7095 : */
7096 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7097 0 : __Pyx_GOTREF(__pyx_t_1);
7098 0 : __Pyx_INCREF(__pyx_v_self->name);
7099 0 : __Pyx_GIVEREF(__pyx_v_self->name);
7100 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name)) __PYX_ERR(1, 5, __pyx_L1_error);
7101 0 : __pyx_v_state = ((PyObject*)__pyx_t_1);
7102 0 : __pyx_t_1 = 0;
7103 :
7104 : /* "(tree fragment)":6
7105 : * cdef bint use_setstate
7106 : * state = (self.name,)
7107 : * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
7108 : * if _dict is not None:
7109 : * state += (_dict,)
7110 : */
7111 0 : __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
7112 0 : __Pyx_GOTREF(__pyx_t_1);
7113 0 : __pyx_v__dict = __pyx_t_1;
7114 0 : __pyx_t_1 = 0;
7115 :
7116 : /* "(tree fragment)":7
7117 : * state = (self.name,)
7118 : * _dict = getattr(self, '__dict__', None)
7119 : * if _dict is not None: # <<<<<<<<<<<<<<
7120 : * state += (_dict,)
7121 : * use_setstate = True
7122 : */
7123 0 : __pyx_t_2 = (__pyx_v__dict != Py_None);
7124 0 : if (__pyx_t_2) {
7125 :
7126 : /* "(tree fragment)":8
7127 : * _dict = getattr(self, '__dict__', None)
7128 : * if _dict is not None:
7129 : * state += (_dict,) # <<<<<<<<<<<<<<
7130 : * use_setstate = True
7131 : * else:
7132 : */
7133 0 : __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
7134 0 : __Pyx_GOTREF(__pyx_t_1);
7135 0 : __Pyx_INCREF(__pyx_v__dict);
7136 0 : __Pyx_GIVEREF(__pyx_v__dict);
7137 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict)) __PYX_ERR(1, 8, __pyx_L1_error);
7138 0 : __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
7139 0 : __Pyx_GOTREF(__pyx_t_3);
7140 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7141 0 : __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
7142 0 : __pyx_t_3 = 0;
7143 :
7144 : /* "(tree fragment)":9
7145 : * if _dict is not None:
7146 : * state += (_dict,)
7147 : * use_setstate = True # <<<<<<<<<<<<<<
7148 : * else:
7149 : * use_setstate = self.name is not None
7150 : */
7151 0 : __pyx_v_use_setstate = 1;
7152 :
7153 : /* "(tree fragment)":7
7154 : * state = (self.name,)
7155 : * _dict = getattr(self, '__dict__', None)
7156 : * if _dict is not None: # <<<<<<<<<<<<<<
7157 : * state += (_dict,)
7158 : * use_setstate = True
7159 : */
7160 0 : goto __pyx_L3;
7161 : }
7162 :
7163 : /* "(tree fragment)":11
7164 : * use_setstate = True
7165 : * else:
7166 : * use_setstate = self.name is not None # <<<<<<<<<<<<<<
7167 : * if use_setstate:
7168 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7169 : */
7170 : /*else*/ {
7171 0 : __pyx_t_2 = (__pyx_v_self->name != Py_None);
7172 0 : __pyx_v_use_setstate = __pyx_t_2;
7173 : }
7174 0 : __pyx_L3:;
7175 :
7176 : /* "(tree fragment)":12
7177 : * else:
7178 : * use_setstate = self.name is not None
7179 : * if use_setstate: # <<<<<<<<<<<<<<
7180 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7181 : * else:
7182 : */
7183 0 : if (__pyx_v_use_setstate) {
7184 :
7185 : /* "(tree fragment)":13
7186 : * use_setstate = self.name is not None
7187 : * if use_setstate:
7188 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state # <<<<<<<<<<<<<<
7189 : * else:
7190 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7191 : */
7192 0 : __Pyx_XDECREF(__pyx_r);
7193 0 : __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
7194 0 : __Pyx_GOTREF(__pyx_t_3);
7195 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
7196 0 : __Pyx_GOTREF(__pyx_t_1);
7197 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7198 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7199 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 13, __pyx_L1_error);
7200 0 : __Pyx_INCREF(__pyx_int_136983863);
7201 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7202 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 13, __pyx_L1_error);
7203 0 : __Pyx_INCREF(Py_None);
7204 0 : __Pyx_GIVEREF(Py_None);
7205 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None)) __PYX_ERR(1, 13, __pyx_L1_error);
7206 0 : __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
7207 0 : __Pyx_GOTREF(__pyx_t_4);
7208 0 : __Pyx_GIVEREF(__pyx_t_3);
7209 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error);
7210 0 : __Pyx_GIVEREF(__pyx_t_1);
7211 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error);
7212 0 : __Pyx_INCREF(__pyx_v_state);
7213 0 : __Pyx_GIVEREF(__pyx_v_state);
7214 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state)) __PYX_ERR(1, 13, __pyx_L1_error);
7215 0 : __pyx_t_3 = 0;
7216 0 : __pyx_t_1 = 0;
7217 0 : __pyx_r = __pyx_t_4;
7218 0 : __pyx_t_4 = 0;
7219 0 : goto __pyx_L0;
7220 :
7221 : /* "(tree fragment)":12
7222 : * else:
7223 : * use_setstate = self.name is not None
7224 : * if use_setstate: # <<<<<<<<<<<<<<
7225 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7226 : * else:
7227 : */
7228 : }
7229 :
7230 : /* "(tree fragment)":15
7231 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, None), state
7232 : * else:
7233 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state) # <<<<<<<<<<<<<<
7234 : * def __setstate_cython__(self, __pyx_state):
7235 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7236 : */
7237 : /*else*/ {
7238 0 : __Pyx_XDECREF(__pyx_r);
7239 0 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
7240 0 : __Pyx_GOTREF(__pyx_t_4);
7241 0 : __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
7242 0 : __Pyx_GOTREF(__pyx_t_1);
7243 0 : __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7244 0 : __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
7245 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))))) __PYX_ERR(1, 15, __pyx_L1_error);
7246 0 : __Pyx_INCREF(__pyx_int_136983863);
7247 0 : __Pyx_GIVEREF(__pyx_int_136983863);
7248 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_136983863)) __PYX_ERR(1, 15, __pyx_L1_error);
7249 0 : __Pyx_INCREF(__pyx_v_state);
7250 0 : __Pyx_GIVEREF(__pyx_v_state);
7251 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state)) __PYX_ERR(1, 15, __pyx_L1_error);
7252 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
7253 0 : __Pyx_GOTREF(__pyx_t_3);
7254 0 : __Pyx_GIVEREF(__pyx_t_4);
7255 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error);
7256 0 : __Pyx_GIVEREF(__pyx_t_1);
7257 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error);
7258 0 : __pyx_t_4 = 0;
7259 0 : __pyx_t_1 = 0;
7260 0 : __pyx_r = __pyx_t_3;
7261 0 : __pyx_t_3 = 0;
7262 0 : goto __pyx_L0;
7263 : }
7264 :
7265 : /* "(tree fragment)":1
7266 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
7267 : * cdef tuple state
7268 : * cdef object _dict
7269 : */
7270 :
7271 : /* function exit code */
7272 0 : __pyx_L1_error:;
7273 0 : __Pyx_XDECREF(__pyx_t_1);
7274 0 : __Pyx_XDECREF(__pyx_t_3);
7275 0 : __Pyx_XDECREF(__pyx_t_4);
7276 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7277 0 : __pyx_r = NULL;
7278 0 : __pyx_L0:;
7279 0 : __Pyx_XDECREF(__pyx_v_state);
7280 0 : __Pyx_XDECREF(__pyx_v__dict);
7281 0 : __Pyx_XGIVEREF(__pyx_r);
7282 0 : __Pyx_RefNannyFinishContext();
7283 0 : return __pyx_r;
7284 : }
7285 :
7286 : /* "(tree fragment)":16
7287 : * else:
7288 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7289 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7290 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7291 : */
7292 :
7293 : /* Python wrapper */
7294 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7295 : #if CYTHON_METH_FASTCALL
7296 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7297 : #else
7298 : PyObject *__pyx_args, PyObject *__pyx_kwds
7299 : #endif
7300 : ); /*proto*/
7301 0 : static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self,
7302 : #if CYTHON_METH_FASTCALL
7303 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
7304 : #else
7305 : PyObject *__pyx_args, PyObject *__pyx_kwds
7306 : #endif
7307 : ) {
7308 0 : PyObject *__pyx_v___pyx_state = 0;
7309 : #if !CYTHON_METH_FASTCALL
7310 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7311 : #endif
7312 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7313 0 : PyObject* values[1] = {0};
7314 0 : int __pyx_lineno = 0;
7315 0 : const char *__pyx_filename = NULL;
7316 0 : int __pyx_clineno = 0;
7317 0 : PyObject *__pyx_r = 0;
7318 : __Pyx_RefNannyDeclarations
7319 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
7320 : #if !CYTHON_METH_FASTCALL
7321 : #if CYTHON_ASSUME_SAFE_MACROS
7322 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7323 : #else
7324 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
7325 : #endif
7326 : #endif
7327 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
7328 : {
7329 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
7330 0 : if (__pyx_kwds) {
7331 0 : Py_ssize_t kw_args;
7332 0 : switch (__pyx_nargs) {
7333 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7334 0 : CYTHON_FALLTHROUGH;
7335 0 : case 0: break;
7336 0 : default: goto __pyx_L5_argtuple_error;
7337 : }
7338 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
7339 0 : switch (__pyx_nargs) {
7340 : case 0:
7341 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
7342 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
7343 0 : kw_args--;
7344 : }
7345 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
7346 0 : else goto __pyx_L5_argtuple_error;
7347 : }
7348 0 : if (unlikely(kw_args > 0)) {
7349 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7350 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
7351 : }
7352 0 : } else if (unlikely(__pyx_nargs != 1)) {
7353 0 : goto __pyx_L5_argtuple_error;
7354 : } else {
7355 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
7356 : }
7357 0 : __pyx_v___pyx_state = values[0];
7358 : }
7359 0 : goto __pyx_L6_skip;
7360 0 : __pyx_L5_argtuple_error:;
7361 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
7362 0 : __pyx_L6_skip:;
7363 0 : goto __pyx_L4_argument_unpacking_done;
7364 0 : __pyx_L3_error:;
7365 : {
7366 0 : Py_ssize_t __pyx_temp;
7367 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7368 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7369 : }
7370 : }
7371 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7372 0 : __Pyx_RefNannyFinishContext();
7373 0 : return NULL;
7374 0 : __pyx_L4_argument_unpacking_done:;
7375 0 : __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v___pyx_state);
7376 :
7377 : /* function exit code */
7378 : {
7379 0 : Py_ssize_t __pyx_temp;
7380 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7381 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
7382 : }
7383 : }
7384 : __Pyx_RefNannyFinishContext();
7385 : return __pyx_r;
7386 : }
7387 :
7388 0 : static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
7389 0 : PyObject *__pyx_r = NULL;
7390 : __Pyx_RefNannyDeclarations
7391 0 : PyObject *__pyx_t_1 = NULL;
7392 0 : int __pyx_lineno = 0;
7393 0 : const char *__pyx_filename = NULL;
7394 0 : int __pyx_clineno = 0;
7395 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
7396 :
7397 : /* "(tree fragment)":17
7398 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7399 : * def __setstate_cython__(self, __pyx_state):
7400 : * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
7401 : */
7402 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
7403 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
7404 0 : __Pyx_GOTREF(__pyx_t_1);
7405 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7406 :
7407 : /* "(tree fragment)":16
7408 : * else:
7409 : * return __pyx_unpickle_Enum, (type(self), 0x82a3537, state)
7410 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
7411 : * __pyx_unpickle_Enum__set_state(self, __pyx_state)
7412 : */
7413 :
7414 : /* function exit code */
7415 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7416 0 : goto __pyx_L0;
7417 0 : __pyx_L1_error:;
7418 0 : __Pyx_XDECREF(__pyx_t_1);
7419 0 : __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7420 0 : __pyx_r = NULL;
7421 0 : __pyx_L0:;
7422 0 : __Pyx_XGIVEREF(__pyx_r);
7423 0 : __Pyx_RefNannyFinishContext();
7424 0 : return __pyx_r;
7425 : }
7426 :
7427 : /* "View.MemoryView":349
7428 : * cdef __Pyx_TypeInfo *typeinfo
7429 : *
7430 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7431 : * self.obj = obj
7432 : * self.flags = flags
7433 : */
7434 :
7435 : /* Python wrapper */
7436 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7437 1066 : static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7438 1066 : PyObject *__pyx_v_obj = 0;
7439 1066 : int __pyx_v_flags;
7440 1066 : int __pyx_v_dtype_is_object;
7441 1066 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
7442 1066 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7443 1066 : PyObject* values[3] = {0,0,0};
7444 1066 : int __pyx_lineno = 0;
7445 1066 : const char *__pyx_filename = NULL;
7446 1066 : int __pyx_clineno = 0;
7447 1066 : int __pyx_r;
7448 : __Pyx_RefNannyDeclarations
7449 1066 : __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7450 : #if CYTHON_ASSUME_SAFE_MACROS
7451 1066 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
7452 : #else
7453 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
7454 : #endif
7455 1066 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7456 : {
7457 1066 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
7458 1066 : if (__pyx_kwds) {
7459 0 : Py_ssize_t kw_args;
7460 0 : switch (__pyx_nargs) {
7461 0 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
7462 0 : CYTHON_FALLTHROUGH;
7463 0 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
7464 0 : CYTHON_FALLTHROUGH;
7465 0 : case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7466 0 : CYTHON_FALLTHROUGH;
7467 0 : case 0: break;
7468 0 : default: goto __pyx_L5_argtuple_error;
7469 : }
7470 0 : kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
7471 0 : switch (__pyx_nargs) {
7472 0 : case 0:
7473 0 : if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_obj)) != 0)) {
7474 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
7475 0 : kw_args--;
7476 : }
7477 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7478 0 : else goto __pyx_L5_argtuple_error;
7479 0 : CYTHON_FALLTHROUGH;
7480 : case 1:
7481 0 : if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_flags)) != 0)) {
7482 0 : (void)__Pyx_Arg_NewRef_VARARGS(values[1]);
7483 0 : kw_args--;
7484 : }
7485 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7486 : else {
7487 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 349, __pyx_L3_error)
7488 : }
7489 0 : CYTHON_FALLTHROUGH;
7490 : case 2:
7491 0 : if (kw_args > 0) {
7492 0 : PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_dtype_is_object);
7493 0 : if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
7494 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7495 : }
7496 : }
7497 0 : if (unlikely(kw_args > 0)) {
7498 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
7499 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__cinit__") < 0)) __PYX_ERR(1, 349, __pyx_L3_error)
7500 : }
7501 : } else {
7502 1066 : switch (__pyx_nargs) {
7503 1066 : case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
7504 1066 : CYTHON_FALLTHROUGH;
7505 1066 : case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
7506 1066 : values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
7507 1066 : break;
7508 0 : default: goto __pyx_L5_argtuple_error;
7509 : }
7510 : }
7511 1066 : __pyx_v_obj = values[0];
7512 1066 : __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7513 1066 : if (values[2]) {
7514 1066 : __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 349, __pyx_L3_error)
7515 : } else {
7516 : __pyx_v_dtype_is_object = ((int)0);
7517 : }
7518 : }
7519 1066 : goto __pyx_L6_skip;
7520 0 : __pyx_L5_argtuple_error:;
7521 0 : __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, __pyx_nargs); __PYX_ERR(1, 349, __pyx_L3_error)
7522 1066 : __pyx_L6_skip:;
7523 1066 : goto __pyx_L4_argument_unpacking_done;
7524 0 : __pyx_L3_error:;
7525 : {
7526 0 : Py_ssize_t __pyx_temp;
7527 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7528 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7529 : }
7530 : }
7531 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7532 0 : __Pyx_RefNannyFinishContext();
7533 0 : return -1;
7534 1066 : __pyx_L4_argument_unpacking_done:;
7535 1066 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
7536 :
7537 : /* function exit code */
7538 : {
7539 1066 : Py_ssize_t __pyx_temp;
7540 1066 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
7541 : __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
7542 : }
7543 : }
7544 : __Pyx_RefNannyFinishContext();
7545 : return __pyx_r;
7546 : }
7547 :
7548 1066 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
7549 1066 : int __pyx_r;
7550 : __Pyx_RefNannyDeclarations
7551 1066 : int __pyx_t_1;
7552 1066 : int __pyx_t_2;
7553 1066 : int __pyx_t_3;
7554 1066 : Py_intptr_t __pyx_t_4;
7555 1066 : size_t __pyx_t_5;
7556 1066 : int __pyx_lineno = 0;
7557 1066 : const char *__pyx_filename = NULL;
7558 1066 : int __pyx_clineno = 0;
7559 1066 : __Pyx_RefNannySetupContext("__cinit__", 1);
7560 :
7561 : /* "View.MemoryView":350
7562 : *
7563 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7564 : * self.obj = obj # <<<<<<<<<<<<<<
7565 : * self.flags = flags
7566 : * if type(self) is memoryview or obj is not None:
7567 : */
7568 1066 : __Pyx_INCREF(__pyx_v_obj);
7569 1066 : __Pyx_GIVEREF(__pyx_v_obj);
7570 1066 : __Pyx_GOTREF(__pyx_v_self->obj);
7571 1066 : __Pyx_DECREF(__pyx_v_self->obj);
7572 1066 : __pyx_v_self->obj = __pyx_v_obj;
7573 :
7574 : /* "View.MemoryView":351
7575 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
7576 : * self.obj = obj
7577 : * self.flags = flags # <<<<<<<<<<<<<<
7578 : * if type(self) is memoryview or obj is not None:
7579 : * __Pyx_GetBuffer(obj, &self.view, flags)
7580 : */
7581 1066 : __pyx_v_self->flags = __pyx_v_flags;
7582 :
7583 : /* "View.MemoryView":352
7584 : * self.obj = obj
7585 : * self.flags = flags
7586 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7587 : * __Pyx_GetBuffer(obj, &self.view, flags)
7588 : * if <PyObject *> self.view.obj == NULL:
7589 : */
7590 1066 : __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
7591 1066 : if (!__pyx_t_2) {
7592 430 : } else {
7593 636 : __pyx_t_1 = __pyx_t_2;
7594 636 : goto __pyx_L4_bool_binop_done;
7595 : }
7596 430 : __pyx_t_2 = (__pyx_v_obj != Py_None);
7597 430 : __pyx_t_1 = __pyx_t_2;
7598 1066 : __pyx_L4_bool_binop_done:;
7599 1066 : if (__pyx_t_1) {
7600 :
7601 : /* "View.MemoryView":353
7602 : * self.flags = flags
7603 : * if type(self) is memoryview or obj is not None:
7604 : * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
7605 : * if <PyObject *> self.view.obj == NULL:
7606 : * (<__pyx_buffer *> &self.view).obj = Py_None
7607 : */
7608 636 : __pyx_t_3 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 353, __pyx_L1_error)
7609 :
7610 : /* "View.MemoryView":354
7611 : * if type(self) is memoryview or obj is not None:
7612 : * __Pyx_GetBuffer(obj, &self.view, flags)
7613 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7614 : * (<__pyx_buffer *> &self.view).obj = Py_None
7615 : * Py_INCREF(Py_None)
7616 : */
7617 635 : __pyx_t_1 = (((PyObject *)__pyx_v_self->view.obj) == NULL);
7618 635 : if (__pyx_t_1) {
7619 :
7620 : /* "View.MemoryView":355
7621 : * __Pyx_GetBuffer(obj, &self.view, flags)
7622 : * if <PyObject *> self.view.obj == NULL:
7623 : * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
7624 : * Py_INCREF(Py_None)
7625 : *
7626 : */
7627 0 : ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
7628 :
7629 : /* "View.MemoryView":356
7630 : * if <PyObject *> self.view.obj == NULL:
7631 : * (<__pyx_buffer *> &self.view).obj = Py_None
7632 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7633 : *
7634 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7635 : */
7636 0 : Py_INCREF(Py_None);
7637 :
7638 : /* "View.MemoryView":354
7639 : * if type(self) is memoryview or obj is not None:
7640 : * __Pyx_GetBuffer(obj, &self.view, flags)
7641 : * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
7642 : * (<__pyx_buffer *> &self.view).obj = Py_None
7643 : * Py_INCREF(Py_None)
7644 : */
7645 : }
7646 :
7647 : /* "View.MemoryView":352
7648 : * self.obj = obj
7649 : * self.flags = flags
7650 : * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
7651 : * __Pyx_GetBuffer(obj, &self.view, flags)
7652 : * if <PyObject *> self.view.obj == NULL:
7653 : */
7654 : }
7655 :
7656 : /* "View.MemoryView":358
7657 : * Py_INCREF(Py_None)
7658 : *
7659 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7660 : * global __pyx_memoryview_thread_locks_used
7661 : * if __pyx_memoryview_thread_locks_used < 8:
7662 : */
7663 1065 : __pyx_t_1 = (!__PYX_CYTHON_ATOMICS_ENABLED());
7664 1065 : if (__pyx_t_1) {
7665 :
7666 : /* "View.MemoryView":360
7667 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7668 : * global __pyx_memoryview_thread_locks_used
7669 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
7670 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7671 : * __pyx_memoryview_thread_locks_used += 1
7672 : */
7673 : __pyx_t_1 = (__pyx_memoryview_thread_locks_used < 8);
7674 : if (__pyx_t_1) {
7675 :
7676 : /* "View.MemoryView":361
7677 : * global __pyx_memoryview_thread_locks_used
7678 : * if __pyx_memoryview_thread_locks_used < 8:
7679 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
7680 : * __pyx_memoryview_thread_locks_used += 1
7681 : * if self.lock is NULL:
7682 : */
7683 : __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
7684 :
7685 : /* "View.MemoryView":362
7686 : * if __pyx_memoryview_thread_locks_used < 8:
7687 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7688 : * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
7689 : * if self.lock is NULL:
7690 : * self.lock = PyThread_allocate_lock()
7691 : */
7692 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
7693 :
7694 : /* "View.MemoryView":360
7695 : * if not __PYX_CYTHON_ATOMICS_ENABLED():
7696 : * global __pyx_memoryview_thread_locks_used
7697 : * if __pyx_memoryview_thread_locks_used < 8: # <<<<<<<<<<<<<<
7698 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7699 : * __pyx_memoryview_thread_locks_used += 1
7700 : */
7701 : }
7702 :
7703 : /* "View.MemoryView":363
7704 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7705 : * __pyx_memoryview_thread_locks_used += 1
7706 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7707 : * self.lock = PyThread_allocate_lock()
7708 : * if self.lock is NULL:
7709 : */
7710 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
7711 : if (__pyx_t_1) {
7712 :
7713 : /* "View.MemoryView":364
7714 : * __pyx_memoryview_thread_locks_used += 1
7715 : * if self.lock is NULL:
7716 : * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
7717 : * if self.lock is NULL:
7718 : * raise MemoryError
7719 : */
7720 : __pyx_v_self->lock = PyThread_allocate_lock();
7721 :
7722 : /* "View.MemoryView":365
7723 : * if self.lock is NULL:
7724 : * self.lock = PyThread_allocate_lock()
7725 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7726 : * raise MemoryError
7727 : *
7728 : */
7729 : __pyx_t_1 = (__pyx_v_self->lock == NULL);
7730 : if (unlikely(__pyx_t_1)) {
7731 :
7732 : /* "View.MemoryView":366
7733 : * self.lock = PyThread_allocate_lock()
7734 : * if self.lock is NULL:
7735 : * raise MemoryError # <<<<<<<<<<<<<<
7736 : *
7737 : * if flags & PyBUF_FORMAT:
7738 : */
7739 : PyErr_NoMemory(); __PYX_ERR(1, 366, __pyx_L1_error)
7740 :
7741 : /* "View.MemoryView":365
7742 : * if self.lock is NULL:
7743 : * self.lock = PyThread_allocate_lock()
7744 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7745 : * raise MemoryError
7746 : *
7747 : */
7748 : }
7749 :
7750 : /* "View.MemoryView":363
7751 : * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
7752 : * __pyx_memoryview_thread_locks_used += 1
7753 : * if self.lock is NULL: # <<<<<<<<<<<<<<
7754 : * self.lock = PyThread_allocate_lock()
7755 : * if self.lock is NULL:
7756 : */
7757 : }
7758 :
7759 : /* "View.MemoryView":358
7760 : * Py_INCREF(Py_None)
7761 : *
7762 : * if not __PYX_CYTHON_ATOMICS_ENABLED(): # <<<<<<<<<<<<<<
7763 : * global __pyx_memoryview_thread_locks_used
7764 : * if __pyx_memoryview_thread_locks_used < 8:
7765 : */
7766 : }
7767 :
7768 : /* "View.MemoryView":368
7769 : * raise MemoryError
7770 : *
7771 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7772 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7773 : * else:
7774 : */
7775 1065 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7776 1065 : if (__pyx_t_1) {
7777 :
7778 : /* "View.MemoryView":369
7779 : *
7780 : * if flags & PyBUF_FORMAT:
7781 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
7782 : * else:
7783 : * self.dtype_is_object = dtype_is_object
7784 : */
7785 635 : __pyx_t_2 = ((__pyx_v_self->view.format[0]) == 'O');
7786 635 : if (__pyx_t_2) {
7787 0 : } else {
7788 635 : __pyx_t_1 = __pyx_t_2;
7789 635 : goto __pyx_L12_bool_binop_done;
7790 : }
7791 0 : __pyx_t_2 = ((__pyx_v_self->view.format[1]) == '\x00');
7792 0 : __pyx_t_1 = __pyx_t_2;
7793 635 : __pyx_L12_bool_binop_done:;
7794 635 : __pyx_v_self->dtype_is_object = __pyx_t_1;
7795 :
7796 : /* "View.MemoryView":368
7797 : * raise MemoryError
7798 : *
7799 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7800 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7801 : * else:
7802 : */
7803 635 : goto __pyx_L11;
7804 : }
7805 :
7806 : /* "View.MemoryView":371
7807 : * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
7808 : * else:
7809 : * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
7810 : *
7811 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
7812 : */
7813 : /*else*/ {
7814 430 : __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
7815 : }
7816 1065 : __pyx_L11:;
7817 :
7818 : /* "View.MemoryView":373
7819 : * self.dtype_is_object = dtype_is_object
7820 : *
7821 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0 # <<<<<<<<<<<<<<
7822 : * self.typeinfo = NULL
7823 : *
7824 : */
7825 : #ifndef CYTHON_WITHOUT_ASSERTIONS
7826 1065 : if (unlikely(__pyx_assertions_enabled())) {
7827 1065 : __pyx_t_4 = ((Py_intptr_t)((void *)(&__pyx_v_self->acquisition_count)));
7828 1065 : __pyx_t_5 = (sizeof(__pyx_atomic_int_type));
7829 1065 : if (unlikely(__pyx_t_5 == 0)) {
7830 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7831 : __PYX_ERR(1, 373, __pyx_L1_error)
7832 : }
7833 1065 : __pyx_t_1 = ((__pyx_t_4 % __pyx_t_5) == 0);
7834 1065 : if (unlikely(!__pyx_t_1)) {
7835 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
7836 0 : __PYX_ERR(1, 373, __pyx_L1_error)
7837 : }
7838 : }
7839 : #else
7840 : if ((1)); else __PYX_ERR(1, 373, __pyx_L1_error)
7841 : #endif
7842 :
7843 : /* "View.MemoryView":374
7844 : *
7845 : * assert <Py_intptr_t><void*>(&self.acquisition_count) % sizeof(__pyx_atomic_int_type) == 0
7846 : * self.typeinfo = NULL # <<<<<<<<<<<<<<
7847 : *
7848 : * def __dealloc__(memoryview self):
7849 : */
7850 1065 : __pyx_v_self->typeinfo = NULL;
7851 :
7852 : /* "View.MemoryView":349
7853 : * cdef __Pyx_TypeInfo *typeinfo
7854 : *
7855 : * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
7856 : * self.obj = obj
7857 : * self.flags = flags
7858 : */
7859 :
7860 : /* function exit code */
7861 1065 : __pyx_r = 0;
7862 1065 : goto __pyx_L0;
7863 1 : __pyx_L1_error:;
7864 1 : __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7865 1 : __pyx_r = -1;
7866 1066 : __pyx_L0:;
7867 1066 : __Pyx_RefNannyFinishContext();
7868 1066 : return __pyx_r;
7869 : }
7870 :
7871 : /* "View.MemoryView":376
7872 : * self.typeinfo = NULL
7873 : *
7874 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
7875 : * if self.obj is not None:
7876 : * __Pyx_ReleaseBuffer(&self.view)
7877 : */
7878 :
7879 : /* Python wrapper */
7880 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
7881 1066 : static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
7882 1066 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
7883 : __Pyx_RefNannyDeclarations
7884 1066 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7885 1066 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7886 1066 : __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
7887 :
7888 : /* function exit code */
7889 1066 : __Pyx_RefNannyFinishContext();
7890 : }
7891 :
7892 1066 : static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
7893 1066 : int __pyx_v_i;
7894 1066 : int __pyx_t_1;
7895 1066 : int __pyx_t_2;
7896 1066 : int __pyx_t_3;
7897 1066 : int __pyx_t_4;
7898 1066 : PyThread_type_lock __pyx_t_5;
7899 1066 : PyThread_type_lock __pyx_t_6;
7900 :
7901 : /* "View.MemoryView":377
7902 : *
7903 : * def __dealloc__(memoryview self):
7904 : * if self.obj is not None: # <<<<<<<<<<<<<<
7905 : * __Pyx_ReleaseBuffer(&self.view)
7906 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7907 : */
7908 1066 : __pyx_t_1 = (__pyx_v_self->obj != Py_None);
7909 1066 : if (__pyx_t_1) {
7910 :
7911 : /* "View.MemoryView":378
7912 : * def __dealloc__(memoryview self):
7913 : * if self.obj is not None:
7914 : * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
7915 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7916 : *
7917 : */
7918 636 : __Pyx_ReleaseBuffer((&__pyx_v_self->view));
7919 :
7920 : /* "View.MemoryView":377
7921 : *
7922 : * def __dealloc__(memoryview self):
7923 : * if self.obj is not None: # <<<<<<<<<<<<<<
7924 : * __Pyx_ReleaseBuffer(&self.view)
7925 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7926 : */
7927 636 : goto __pyx_L3;
7928 : }
7929 :
7930 : /* "View.MemoryView":379
7931 : * if self.obj is not None:
7932 : * __Pyx_ReleaseBuffer(&self.view)
7933 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7934 : *
7935 : * (<__pyx_buffer *> &self.view).obj = NULL
7936 : */
7937 430 : __pyx_t_1 = (((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None);
7938 430 : if (__pyx_t_1) {
7939 :
7940 : /* "View.MemoryView":381
7941 : * elif (<__pyx_buffer *> &self.view).obj == Py_None:
7942 : *
7943 : * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
7944 : * Py_DECREF(Py_None)
7945 : *
7946 : */
7947 430 : ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
7948 :
7949 : /* "View.MemoryView":382
7950 : *
7951 : * (<__pyx_buffer *> &self.view).obj = NULL
7952 : * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
7953 : *
7954 : * cdef int i
7955 : */
7956 430 : Py_DECREF(Py_None);
7957 :
7958 : /* "View.MemoryView":379
7959 : * if self.obj is not None:
7960 : * __Pyx_ReleaseBuffer(&self.view)
7961 : * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
7962 : *
7963 : * (<__pyx_buffer *> &self.view).obj = NULL
7964 : */
7965 : }
7966 0 : __pyx_L3:;
7967 :
7968 : /* "View.MemoryView":386
7969 : * cdef int i
7970 : * global __pyx_memoryview_thread_locks_used
7971 : * if self.lock != NULL: # <<<<<<<<<<<<<<
7972 : * for i in range(__pyx_memoryview_thread_locks_used):
7973 : * if __pyx_memoryview_thread_locks[i] is self.lock:
7974 : */
7975 1066 : __pyx_t_1 = (__pyx_v_self->lock != NULL);
7976 1066 : if (__pyx_t_1) {
7977 :
7978 : /* "View.MemoryView":387
7979 : * global __pyx_memoryview_thread_locks_used
7980 : * if self.lock != NULL:
7981 : * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
7982 : * if __pyx_memoryview_thread_locks[i] is self.lock:
7983 : * __pyx_memoryview_thread_locks_used -= 1
7984 : */
7985 0 : __pyx_t_2 = __pyx_memoryview_thread_locks_used;
7986 0 : __pyx_t_3 = __pyx_t_2;
7987 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
7988 0 : __pyx_v_i = __pyx_t_4;
7989 :
7990 : /* "View.MemoryView":388
7991 : * if self.lock != NULL:
7992 : * for i in range(__pyx_memoryview_thread_locks_used):
7993 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
7994 : * __pyx_memoryview_thread_locks_used -= 1
7995 : * if i != __pyx_memoryview_thread_locks_used:
7996 : */
7997 0 : __pyx_t_1 = ((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock);
7998 0 : if (__pyx_t_1) {
7999 :
8000 : /* "View.MemoryView":389
8001 : * for i in range(__pyx_memoryview_thread_locks_used):
8002 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8003 : * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
8004 : * if i != __pyx_memoryview_thread_locks_used:
8005 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8006 : */
8007 0 : __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
8008 :
8009 : /* "View.MemoryView":390
8010 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8011 : * __pyx_memoryview_thread_locks_used -= 1
8012 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8013 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8014 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8015 : */
8016 0 : __pyx_t_1 = (__pyx_v_i != __pyx_memoryview_thread_locks_used);
8017 0 : if (__pyx_t_1) {
8018 :
8019 : /* "View.MemoryView":392
8020 : * if i != __pyx_memoryview_thread_locks_used:
8021 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8022 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
8023 : * break
8024 : * else:
8025 : */
8026 0 : __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
8027 0 : __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
8028 :
8029 : /* "View.MemoryView":391
8030 : * __pyx_memoryview_thread_locks_used -= 1
8031 : * if i != __pyx_memoryview_thread_locks_used:
8032 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
8033 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8034 : * break
8035 : */
8036 0 : (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
8037 0 : (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
8038 :
8039 : /* "View.MemoryView":390
8040 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8041 : * __pyx_memoryview_thread_locks_used -= 1
8042 : * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
8043 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8044 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8045 : */
8046 : }
8047 :
8048 : /* "View.MemoryView":393
8049 : * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
8050 : * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
8051 : * break # <<<<<<<<<<<<<<
8052 : * else:
8053 : * PyThread_free_lock(self.lock)
8054 : */
8055 0 : goto __pyx_L6_break;
8056 :
8057 : /* "View.MemoryView":388
8058 : * if self.lock != NULL:
8059 : * for i in range(__pyx_memoryview_thread_locks_used):
8060 : * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
8061 : * __pyx_memoryview_thread_locks_used -= 1
8062 : * if i != __pyx_memoryview_thread_locks_used:
8063 : */
8064 : }
8065 : }
8066 : /*else*/ {
8067 :
8068 : /* "View.MemoryView":395
8069 : * break
8070 : * else:
8071 : * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
8072 : *
8073 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8074 : */
8075 0 : PyThread_free_lock(__pyx_v_self->lock);
8076 : }
8077 1066 : __pyx_L6_break:;
8078 :
8079 : /* "View.MemoryView":386
8080 : * cdef int i
8081 : * global __pyx_memoryview_thread_locks_used
8082 : * if self.lock != NULL: # <<<<<<<<<<<<<<
8083 : * for i in range(__pyx_memoryview_thread_locks_used):
8084 : * if __pyx_memoryview_thread_locks[i] is self.lock:
8085 : */
8086 : }
8087 :
8088 : /* "View.MemoryView":376
8089 : * self.typeinfo = NULL
8090 : *
8091 : * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
8092 : * if self.obj is not None:
8093 : * __Pyx_ReleaseBuffer(&self.view)
8094 : */
8095 :
8096 : /* function exit code */
8097 1066 : }
8098 :
8099 : /* "View.MemoryView":397
8100 : * PyThread_free_lock(self.lock)
8101 : *
8102 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8103 : * cdef Py_ssize_t dim
8104 : * cdef char *itemp = <char *> self.view.buf
8105 : */
8106 :
8107 0 : static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8108 0 : Py_ssize_t __pyx_v_dim;
8109 0 : char *__pyx_v_itemp;
8110 0 : PyObject *__pyx_v_idx = NULL;
8111 0 : char *__pyx_r;
8112 : __Pyx_RefNannyDeclarations
8113 0 : Py_ssize_t __pyx_t_1;
8114 0 : PyObject *__pyx_t_2 = NULL;
8115 0 : Py_ssize_t __pyx_t_3;
8116 0 : PyObject *(*__pyx_t_4)(PyObject *);
8117 0 : PyObject *__pyx_t_5 = NULL;
8118 0 : Py_ssize_t __pyx_t_6;
8119 0 : char *__pyx_t_7;
8120 0 : int __pyx_lineno = 0;
8121 0 : const char *__pyx_filename = NULL;
8122 0 : int __pyx_clineno = 0;
8123 0 : __Pyx_RefNannySetupContext("get_item_pointer", 1);
8124 :
8125 : /* "View.MemoryView":399
8126 : * cdef char *get_item_pointer(memoryview self, object index) except NULL:
8127 : * cdef Py_ssize_t dim
8128 : * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
8129 : *
8130 : * for dim, idx in enumerate(index):
8131 : */
8132 0 : __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
8133 :
8134 : /* "View.MemoryView":401
8135 : * cdef char *itemp = <char *> self.view.buf
8136 : *
8137 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8138 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8139 : *
8140 : */
8141 0 : __pyx_t_1 = 0;
8142 0 : if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
8143 0 : __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2);
8144 0 : __pyx_t_3 = 0;
8145 0 : __pyx_t_4 = NULL;
8146 : } else {
8147 0 : __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
8148 0 : __Pyx_GOTREF(__pyx_t_2);
8149 0 : __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 401, __pyx_L1_error)
8150 : }
8151 0 : for (;;) {
8152 0 : if (likely(!__pyx_t_4)) {
8153 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
8154 : {
8155 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
8156 : #if !CYTHON_ASSUME_SAFE_MACROS
8157 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8158 : #endif
8159 0 : if (__pyx_t_3 >= __pyx_temp) break;
8160 : }
8161 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8162 0 : __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8163 : #else
8164 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8165 : __Pyx_GOTREF(__pyx_t_5);
8166 : #endif
8167 : } else {
8168 : {
8169 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
8170 : #if !CYTHON_ASSUME_SAFE_MACROS
8171 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8172 : #endif
8173 0 : if (__pyx_t_3 >= __pyx_temp) break;
8174 : }
8175 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8176 0 : __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(1, 401, __pyx_L1_error)
8177 : #else
8178 : __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
8179 : __Pyx_GOTREF(__pyx_t_5);
8180 : #endif
8181 : }
8182 : } else {
8183 0 : __pyx_t_5 = __pyx_t_4(__pyx_t_2);
8184 0 : if (unlikely(!__pyx_t_5)) {
8185 0 : PyObject* exc_type = PyErr_Occurred();
8186 0 : if (exc_type) {
8187 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8188 0 : else __PYX_ERR(1, 401, __pyx_L1_error)
8189 : }
8190 : break;
8191 : }
8192 0 : __Pyx_GOTREF(__pyx_t_5);
8193 : }
8194 0 : __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
8195 0 : __pyx_t_5 = 0;
8196 0 : __pyx_v_dim = __pyx_t_1;
8197 0 : __pyx_t_1 = (__pyx_t_1 + 1);
8198 :
8199 : /* "View.MemoryView":402
8200 : *
8201 : * for dim, idx in enumerate(index):
8202 : * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
8203 : *
8204 : * return itemp
8205 : */
8206 0 : __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 402, __pyx_L1_error)
8207 0 : __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 402, __pyx_L1_error)
8208 : __pyx_v_itemp = __pyx_t_7;
8209 :
8210 : /* "View.MemoryView":401
8211 : * cdef char *itemp = <char *> self.view.buf
8212 : *
8213 : * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
8214 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8215 : *
8216 : */
8217 : }
8218 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8219 :
8220 : /* "View.MemoryView":404
8221 : * itemp = pybuffer_index(&self.view, itemp, idx, dim)
8222 : *
8223 : * return itemp # <<<<<<<<<<<<<<
8224 : *
8225 : *
8226 : */
8227 0 : __pyx_r = __pyx_v_itemp;
8228 0 : goto __pyx_L0;
8229 :
8230 : /* "View.MemoryView":397
8231 : * PyThread_free_lock(self.lock)
8232 : *
8233 : * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
8234 : * cdef Py_ssize_t dim
8235 : * cdef char *itemp = <char *> self.view.buf
8236 : */
8237 :
8238 : /* function exit code */
8239 0 : __pyx_L1_error:;
8240 0 : __Pyx_XDECREF(__pyx_t_2);
8241 0 : __Pyx_XDECREF(__pyx_t_5);
8242 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
8243 0 : __pyx_r = NULL;
8244 0 : __pyx_L0:;
8245 0 : __Pyx_XDECREF(__pyx_v_idx);
8246 0 : __Pyx_RefNannyFinishContext();
8247 0 : return __pyx_r;
8248 : }
8249 :
8250 : /* "View.MemoryView":407
8251 : *
8252 : *
8253 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8254 : * if index is Ellipsis:
8255 : * return self
8256 : */
8257 :
8258 : /* Python wrapper */
8259 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
8260 0 : static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
8261 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8262 0 : PyObject *__pyx_r = 0;
8263 : __Pyx_RefNannyDeclarations
8264 0 : __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8265 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8266 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
8267 :
8268 : /* function exit code */
8269 0 : __Pyx_RefNannyFinishContext();
8270 0 : return __pyx_r;
8271 : }
8272 :
8273 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
8274 0 : PyObject *__pyx_v_have_slices = NULL;
8275 0 : PyObject *__pyx_v_indices = NULL;
8276 0 : char *__pyx_v_itemp;
8277 0 : PyObject *__pyx_r = NULL;
8278 : __Pyx_RefNannyDeclarations
8279 0 : int __pyx_t_1;
8280 0 : PyObject *__pyx_t_2 = NULL;
8281 0 : PyObject *__pyx_t_3 = NULL;
8282 0 : PyObject *__pyx_t_4 = NULL;
8283 0 : char *__pyx_t_5;
8284 0 : int __pyx_lineno = 0;
8285 0 : const char *__pyx_filename = NULL;
8286 0 : int __pyx_clineno = 0;
8287 0 : __Pyx_RefNannySetupContext("__getitem__", 1);
8288 :
8289 : /* "View.MemoryView":408
8290 : *
8291 : * def __getitem__(memoryview self, object index):
8292 : * if index is Ellipsis: # <<<<<<<<<<<<<<
8293 : * return self
8294 : *
8295 : */
8296 0 : __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
8297 0 : if (__pyx_t_1) {
8298 :
8299 : /* "View.MemoryView":409
8300 : * def __getitem__(memoryview self, object index):
8301 : * if index is Ellipsis:
8302 : * return self # <<<<<<<<<<<<<<
8303 : *
8304 : * have_slices, indices = _unellipsify(index, self.view.ndim)
8305 : */
8306 0 : __Pyx_XDECREF(__pyx_r);
8307 0 : __Pyx_INCREF((PyObject *)__pyx_v_self);
8308 0 : __pyx_r = ((PyObject *)__pyx_v_self);
8309 0 : goto __pyx_L0;
8310 :
8311 : /* "View.MemoryView":408
8312 : *
8313 : * def __getitem__(memoryview self, object index):
8314 : * if index is Ellipsis: # <<<<<<<<<<<<<<
8315 : * return self
8316 : *
8317 : */
8318 : }
8319 :
8320 : /* "View.MemoryView":411
8321 : * return self
8322 : *
8323 : * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8324 : *
8325 : * cdef char *itemp
8326 : */
8327 0 : __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 411, __pyx_L1_error)
8328 0 : __Pyx_GOTREF(__pyx_t_2);
8329 0 : if (likely(__pyx_t_2 != Py_None)) {
8330 0 : PyObject* sequence = __pyx_t_2;
8331 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8332 0 : if (unlikely(size != 2)) {
8333 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8334 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8335 0 : __PYX_ERR(1, 411, __pyx_L1_error)
8336 : }
8337 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8338 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
8339 0 : __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
8340 0 : __Pyx_INCREF(__pyx_t_3);
8341 0 : __Pyx_INCREF(__pyx_t_4);
8342 : #else
8343 : __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
8344 : __Pyx_GOTREF(__pyx_t_3);
8345 : __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 411, __pyx_L1_error)
8346 : __Pyx_GOTREF(__pyx_t_4);
8347 : #endif
8348 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8349 : } else {
8350 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 411, __pyx_L1_error)
8351 : }
8352 0 : __pyx_v_have_slices = __pyx_t_3;
8353 0 : __pyx_t_3 = 0;
8354 0 : __pyx_v_indices = __pyx_t_4;
8355 0 : __pyx_t_4 = 0;
8356 :
8357 : /* "View.MemoryView":414
8358 : *
8359 : * cdef char *itemp
8360 : * if have_slices: # <<<<<<<<<<<<<<
8361 : * return memview_slice(self, indices)
8362 : * else:
8363 : */
8364 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 414, __pyx_L1_error)
8365 0 : if (__pyx_t_1) {
8366 :
8367 : /* "View.MemoryView":415
8368 : * cdef char *itemp
8369 : * if have_slices:
8370 : * return memview_slice(self, indices) # <<<<<<<<<<<<<<
8371 : * else:
8372 : * itemp = self.get_item_pointer(indices)
8373 : */
8374 0 : __Pyx_XDECREF(__pyx_r);
8375 0 : __pyx_t_2 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 415, __pyx_L1_error)
8376 0 : __Pyx_GOTREF(__pyx_t_2);
8377 0 : __pyx_r = __pyx_t_2;
8378 0 : __pyx_t_2 = 0;
8379 0 : goto __pyx_L0;
8380 :
8381 : /* "View.MemoryView":414
8382 : *
8383 : * cdef char *itemp
8384 : * if have_slices: # <<<<<<<<<<<<<<
8385 : * return memview_slice(self, indices)
8386 : * else:
8387 : */
8388 : }
8389 :
8390 : /* "View.MemoryView":417
8391 : * return memview_slice(self, indices)
8392 : * else:
8393 : * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
8394 : * return self.convert_item_to_object(itemp)
8395 : *
8396 : */
8397 : /*else*/ {
8398 0 : __pyx_t_5 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(1, 417, __pyx_L1_error)
8399 0 : __pyx_v_itemp = __pyx_t_5;
8400 :
8401 : /* "View.MemoryView":418
8402 : * else:
8403 : * itemp = self.get_item_pointer(indices)
8404 : * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
8405 : *
8406 : * def __setitem__(memoryview self, object index, object value):
8407 : */
8408 0 : __Pyx_XDECREF(__pyx_r);
8409 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
8410 0 : __Pyx_GOTREF(__pyx_t_2);
8411 0 : __pyx_r = __pyx_t_2;
8412 0 : __pyx_t_2 = 0;
8413 0 : goto __pyx_L0;
8414 : }
8415 :
8416 : /* "View.MemoryView":407
8417 : *
8418 : *
8419 : * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
8420 : * if index is Ellipsis:
8421 : * return self
8422 : */
8423 :
8424 : /* function exit code */
8425 0 : __pyx_L1_error:;
8426 0 : __Pyx_XDECREF(__pyx_t_2);
8427 0 : __Pyx_XDECREF(__pyx_t_3);
8428 0 : __Pyx_XDECREF(__pyx_t_4);
8429 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8430 0 : __pyx_r = NULL;
8431 0 : __pyx_L0:;
8432 0 : __Pyx_XDECREF(__pyx_v_have_slices);
8433 0 : __Pyx_XDECREF(__pyx_v_indices);
8434 0 : __Pyx_XGIVEREF(__pyx_r);
8435 0 : __Pyx_RefNannyFinishContext();
8436 0 : return __pyx_r;
8437 : }
8438 :
8439 : /* "View.MemoryView":420
8440 : * return self.convert_item_to_object(itemp)
8441 : *
8442 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8443 : * if self.view.readonly:
8444 : * raise TypeError, "Cannot assign to read-only memoryview"
8445 : */
8446 :
8447 : /* Python wrapper */
8448 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
8449 0 : static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8450 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
8451 0 : int __pyx_r;
8452 : __Pyx_RefNannyDeclarations
8453 0 : __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8454 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8455 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
8456 :
8457 : /* function exit code */
8458 0 : __Pyx_RefNannyFinishContext();
8459 0 : return __pyx_r;
8460 : }
8461 :
8462 0 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
8463 0 : PyObject *__pyx_v_have_slices = NULL;
8464 0 : PyObject *__pyx_v_obj = NULL;
8465 0 : int __pyx_r;
8466 : __Pyx_RefNannyDeclarations
8467 0 : PyObject *__pyx_t_1 = NULL;
8468 0 : PyObject *__pyx_t_2 = NULL;
8469 0 : PyObject *__pyx_t_3 = NULL;
8470 0 : int __pyx_t_4;
8471 0 : int __pyx_lineno = 0;
8472 0 : const char *__pyx_filename = NULL;
8473 0 : int __pyx_clineno = 0;
8474 0 : __Pyx_RefNannySetupContext("__setitem__", 0);
8475 0 : __Pyx_INCREF(__pyx_v_index);
8476 :
8477 : /* "View.MemoryView":421
8478 : *
8479 : * def __setitem__(memoryview self, object index, object value):
8480 : * if self.view.readonly: # <<<<<<<<<<<<<<
8481 : * raise TypeError, "Cannot assign to read-only memoryview"
8482 : *
8483 : */
8484 0 : if (unlikely(__pyx_v_self->view.readonly)) {
8485 :
8486 : /* "View.MemoryView":422
8487 : * def __setitem__(memoryview self, object index, object value):
8488 : * if self.view.readonly:
8489 : * raise TypeError, "Cannot assign to read-only memoryview" # <<<<<<<<<<<<<<
8490 : *
8491 : * have_slices, index = _unellipsify(index, self.view.ndim)
8492 : */
8493 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Cannot_assign_to_read_only_memor, 0, 0);
8494 0 : __PYX_ERR(1, 422, __pyx_L1_error)
8495 :
8496 : /* "View.MemoryView":421
8497 : *
8498 : * def __setitem__(memoryview self, object index, object value):
8499 : * if self.view.readonly: # <<<<<<<<<<<<<<
8500 : * raise TypeError, "Cannot assign to read-only memoryview"
8501 : *
8502 : */
8503 : }
8504 :
8505 : /* "View.MemoryView":424
8506 : * raise TypeError, "Cannot assign to read-only memoryview"
8507 : *
8508 : * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
8509 : *
8510 : * if have_slices:
8511 : */
8512 0 : __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 424, __pyx_L1_error)
8513 0 : __Pyx_GOTREF(__pyx_t_1);
8514 0 : if (likely(__pyx_t_1 != Py_None)) {
8515 0 : PyObject* sequence = __pyx_t_1;
8516 0 : Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8517 0 : if (unlikely(size != 2)) {
8518 0 : if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8519 0 : else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8520 0 : __PYX_ERR(1, 424, __pyx_L1_error)
8521 : }
8522 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8523 0 : __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
8524 0 : __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
8525 0 : __Pyx_INCREF(__pyx_t_2);
8526 0 : __Pyx_INCREF(__pyx_t_3);
8527 : #else
8528 : __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 424, __pyx_L1_error)
8529 : __Pyx_GOTREF(__pyx_t_2);
8530 : __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 424, __pyx_L1_error)
8531 : __Pyx_GOTREF(__pyx_t_3);
8532 : #endif
8533 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8534 : } else {
8535 0 : __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 424, __pyx_L1_error)
8536 : }
8537 0 : __pyx_v_have_slices = __pyx_t_2;
8538 0 : __pyx_t_2 = 0;
8539 0 : __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_3);
8540 0 : __pyx_t_3 = 0;
8541 :
8542 : /* "View.MemoryView":426
8543 : * have_slices, index = _unellipsify(index, self.view.ndim)
8544 : *
8545 : * if have_slices: # <<<<<<<<<<<<<<
8546 : * obj = self.is_slice(value)
8547 : * if obj is not None:
8548 : */
8549 0 : __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(1, 426, __pyx_L1_error)
8550 0 : if (__pyx_t_4) {
8551 :
8552 : /* "View.MemoryView":427
8553 : *
8554 : * if have_slices:
8555 : * obj = self.is_slice(value) # <<<<<<<<<<<<<<
8556 : * if obj is not None:
8557 : * self.setitem_slice_assignment(self[index], obj)
8558 : */
8559 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 427, __pyx_L1_error)
8560 0 : __Pyx_GOTREF(__pyx_t_1);
8561 0 : __pyx_v_obj = __pyx_t_1;
8562 0 : __pyx_t_1 = 0;
8563 :
8564 : /* "View.MemoryView":428
8565 : * if have_slices:
8566 : * obj = self.is_slice(value)
8567 : * if obj is not None: # <<<<<<<<<<<<<<
8568 : * self.setitem_slice_assignment(self[index], obj)
8569 : * else:
8570 : */
8571 0 : __pyx_t_4 = (__pyx_v_obj != Py_None);
8572 0 : if (__pyx_t_4) {
8573 :
8574 : /* "View.MemoryView":429
8575 : * obj = self.is_slice(value)
8576 : * if obj is not None:
8577 : * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
8578 : * else:
8579 : * self.setitem_slice_assign_scalar(self[index], value)
8580 : */
8581 0 : __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 429, __pyx_L1_error)
8582 0 : __Pyx_GOTREF(__pyx_t_1);
8583 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 429, __pyx_L1_error)
8584 0 : __Pyx_GOTREF(__pyx_t_3);
8585 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8586 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8587 :
8588 : /* "View.MemoryView":428
8589 : * if have_slices:
8590 : * obj = self.is_slice(value)
8591 : * if obj is not None: # <<<<<<<<<<<<<<
8592 : * self.setitem_slice_assignment(self[index], obj)
8593 : * else:
8594 : */
8595 0 : goto __pyx_L5;
8596 : }
8597 :
8598 : /* "View.MemoryView":431
8599 : * self.setitem_slice_assignment(self[index], obj)
8600 : * else:
8601 : * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
8602 : * else:
8603 : * self.setitem_indexed(index, value)
8604 : */
8605 : /*else*/ {
8606 0 : __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 431, __pyx_L1_error)
8607 0 : __Pyx_GOTREF(__pyx_t_3);
8608 0 : if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 431, __pyx_L1_error)
8609 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
8610 0 : __Pyx_GOTREF(__pyx_t_1);
8611 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8612 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8613 : }
8614 0 : __pyx_L5:;
8615 :
8616 : /* "View.MemoryView":426
8617 : * have_slices, index = _unellipsify(index, self.view.ndim)
8618 : *
8619 : * if have_slices: # <<<<<<<<<<<<<<
8620 : * obj = self.is_slice(value)
8621 : * if obj is not None:
8622 : */
8623 0 : goto __pyx_L4;
8624 : }
8625 :
8626 : /* "View.MemoryView":433
8627 : * self.setitem_slice_assign_scalar(self[index], value)
8628 : * else:
8629 : * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
8630 : *
8631 : * cdef is_slice(self, obj):
8632 : */
8633 : /*else*/ {
8634 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 433, __pyx_L1_error)
8635 0 : __Pyx_GOTREF(__pyx_t_1);
8636 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8637 : }
8638 0 : __pyx_L4:;
8639 :
8640 : /* "View.MemoryView":420
8641 : * return self.convert_item_to_object(itemp)
8642 : *
8643 : * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
8644 : * if self.view.readonly:
8645 : * raise TypeError, "Cannot assign to read-only memoryview"
8646 : */
8647 :
8648 : /* function exit code */
8649 0 : __pyx_r = 0;
8650 0 : goto __pyx_L0;
8651 0 : __pyx_L1_error:;
8652 0 : __Pyx_XDECREF(__pyx_t_1);
8653 0 : __Pyx_XDECREF(__pyx_t_2);
8654 0 : __Pyx_XDECREF(__pyx_t_3);
8655 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8656 0 : __pyx_r = -1;
8657 0 : __pyx_L0:;
8658 0 : __Pyx_XDECREF(__pyx_v_have_slices);
8659 0 : __Pyx_XDECREF(__pyx_v_obj);
8660 0 : __Pyx_XDECREF(__pyx_v_index);
8661 0 : __Pyx_RefNannyFinishContext();
8662 0 : return __pyx_r;
8663 : }
8664 :
8665 : /* "View.MemoryView":435
8666 : * self.setitem_indexed(index, value)
8667 : *
8668 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8669 : * if not isinstance(obj, memoryview):
8670 : * try:
8671 : */
8672 :
8673 0 : static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
8674 0 : PyObject *__pyx_r = NULL;
8675 : __Pyx_RefNannyDeclarations
8676 0 : int __pyx_t_1;
8677 0 : int __pyx_t_2;
8678 0 : PyObject *__pyx_t_3 = NULL;
8679 0 : PyObject *__pyx_t_4 = NULL;
8680 0 : PyObject *__pyx_t_5 = NULL;
8681 0 : PyObject *__pyx_t_6 = NULL;
8682 0 : PyObject *__pyx_t_7 = NULL;
8683 0 : PyObject *__pyx_t_8 = NULL;
8684 0 : int __pyx_t_9;
8685 0 : int __pyx_lineno = 0;
8686 0 : const char *__pyx_filename = NULL;
8687 0 : int __pyx_clineno = 0;
8688 0 : __Pyx_RefNannySetupContext("is_slice", 0);
8689 0 : __Pyx_INCREF(__pyx_v_obj);
8690 :
8691 : /* "View.MemoryView":436
8692 : *
8693 : * cdef is_slice(self, obj):
8694 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8695 : * try:
8696 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8697 : */
8698 0 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
8699 0 : __pyx_t_2 = (!__pyx_t_1);
8700 0 : if (__pyx_t_2) {
8701 :
8702 : /* "View.MemoryView":437
8703 : * cdef is_slice(self, obj):
8704 : * if not isinstance(obj, memoryview):
8705 : * try: # <<<<<<<<<<<<<<
8706 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8707 : * self.dtype_is_object)
8708 : */
8709 : {
8710 0 : __Pyx_PyThreadState_declare
8711 0 : __Pyx_PyThreadState_assign
8712 0 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
8713 0 : __Pyx_XGOTREF(__pyx_t_3);
8714 0 : __Pyx_XGOTREF(__pyx_t_4);
8715 0 : __Pyx_XGOTREF(__pyx_t_5);
8716 : /*try:*/ {
8717 :
8718 : /* "View.MemoryView":438
8719 : * if not isinstance(obj, memoryview):
8720 : * try:
8721 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8722 : * self.dtype_is_object)
8723 : * except TypeError:
8724 : */
8725 0 : __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error)
8726 0 : __Pyx_GOTREF(__pyx_t_6);
8727 :
8728 : /* "View.MemoryView":439
8729 : * try:
8730 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8731 : * self.dtype_is_object) # <<<<<<<<<<<<<<
8732 : * except TypeError:
8733 : * return None
8734 : */
8735 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 439, __pyx_L4_error)
8736 0 : __Pyx_GOTREF(__pyx_t_7);
8737 :
8738 : /* "View.MemoryView":438
8739 : * if not isinstance(obj, memoryview):
8740 : * try:
8741 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
8742 : * self.dtype_is_object)
8743 : * except TypeError:
8744 : */
8745 0 : __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 438, __pyx_L4_error)
8746 0 : __Pyx_GOTREF(__pyx_t_8);
8747 0 : __Pyx_INCREF(__pyx_v_obj);
8748 0 : __Pyx_GIVEREF(__pyx_v_obj);
8749 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj)) __PYX_ERR(1, 438, __pyx_L4_error);
8750 0 : __Pyx_GIVEREF(__pyx_t_6);
8751 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(1, 438, __pyx_L4_error);
8752 0 : __Pyx_GIVEREF(__pyx_t_7);
8753 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error);
8754 0 : __pyx_t_6 = 0;
8755 0 : __pyx_t_7 = 0;
8756 0 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 438, __pyx_L4_error)
8757 0 : __Pyx_GOTREF(__pyx_t_7);
8758 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8759 0 : __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
8760 0 : __pyx_t_7 = 0;
8761 :
8762 : /* "View.MemoryView":437
8763 : * cdef is_slice(self, obj):
8764 : * if not isinstance(obj, memoryview):
8765 : * try: # <<<<<<<<<<<<<<
8766 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8767 : * self.dtype_is_object)
8768 : */
8769 : }
8770 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8771 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8772 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8773 0 : goto __pyx_L9_try_end;
8774 0 : __pyx_L4_error:;
8775 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8776 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
8777 0 : __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
8778 :
8779 : /* "View.MemoryView":440
8780 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8781 : * self.dtype_is_object)
8782 : * except TypeError: # <<<<<<<<<<<<<<
8783 : * return None
8784 : *
8785 : */
8786 0 : __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
8787 0 : if (__pyx_t_9) {
8788 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8789 0 : if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 440, __pyx_L6_except_error)
8790 0 : __Pyx_XGOTREF(__pyx_t_7);
8791 0 : __Pyx_XGOTREF(__pyx_t_8);
8792 0 : __Pyx_XGOTREF(__pyx_t_6);
8793 :
8794 : /* "View.MemoryView":441
8795 : * self.dtype_is_object)
8796 : * except TypeError:
8797 : * return None # <<<<<<<<<<<<<<
8798 : *
8799 : * return obj
8800 : */
8801 0 : __Pyx_XDECREF(__pyx_r);
8802 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8803 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8804 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8805 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8806 0 : goto __pyx_L7_except_return;
8807 : }
8808 0 : goto __pyx_L6_except_error;
8809 :
8810 : /* "View.MemoryView":437
8811 : * cdef is_slice(self, obj):
8812 : * if not isinstance(obj, memoryview):
8813 : * try: # <<<<<<<<<<<<<<
8814 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8815 : * self.dtype_is_object)
8816 : */
8817 0 : __pyx_L6_except_error:;
8818 0 : __Pyx_XGIVEREF(__pyx_t_3);
8819 0 : __Pyx_XGIVEREF(__pyx_t_4);
8820 0 : __Pyx_XGIVEREF(__pyx_t_5);
8821 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8822 0 : goto __pyx_L1_error;
8823 0 : __pyx_L7_except_return:;
8824 0 : __Pyx_XGIVEREF(__pyx_t_3);
8825 0 : __Pyx_XGIVEREF(__pyx_t_4);
8826 0 : __Pyx_XGIVEREF(__pyx_t_5);
8827 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
8828 0 : goto __pyx_L0;
8829 0 : __pyx_L9_try_end:;
8830 : }
8831 :
8832 : /* "View.MemoryView":436
8833 : *
8834 : * cdef is_slice(self, obj):
8835 : * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
8836 : * try:
8837 : * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
8838 : */
8839 : }
8840 :
8841 : /* "View.MemoryView":443
8842 : * return None
8843 : *
8844 : * return obj # <<<<<<<<<<<<<<
8845 : *
8846 : * cdef setitem_slice_assignment(self, dst, src):
8847 : */
8848 0 : __Pyx_XDECREF(__pyx_r);
8849 0 : __Pyx_INCREF(__pyx_v_obj);
8850 0 : __pyx_r = __pyx_v_obj;
8851 0 : goto __pyx_L0;
8852 :
8853 : /* "View.MemoryView":435
8854 : * self.setitem_indexed(index, value)
8855 : *
8856 : * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
8857 : * if not isinstance(obj, memoryview):
8858 : * try:
8859 : */
8860 :
8861 : /* function exit code */
8862 0 : __pyx_L1_error:;
8863 0 : __Pyx_XDECREF(__pyx_t_6);
8864 0 : __Pyx_XDECREF(__pyx_t_7);
8865 0 : __Pyx_XDECREF(__pyx_t_8);
8866 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
8867 0 : __pyx_r = 0;
8868 0 : __pyx_L0:;
8869 0 : __Pyx_XDECREF(__pyx_v_obj);
8870 0 : __Pyx_XGIVEREF(__pyx_r);
8871 0 : __Pyx_RefNannyFinishContext();
8872 0 : return __pyx_r;
8873 : }
8874 :
8875 : /* "View.MemoryView":445
8876 : * return obj
8877 : *
8878 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8879 : * cdef __Pyx_memviewslice dst_slice
8880 : * cdef __Pyx_memviewslice src_slice
8881 : */
8882 :
8883 0 : static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
8884 0 : __Pyx_memviewslice __pyx_v_dst_slice;
8885 0 : __Pyx_memviewslice __pyx_v_src_slice;
8886 0 : __Pyx_memviewslice __pyx_v_msrc;
8887 0 : __Pyx_memviewslice __pyx_v_mdst;
8888 0 : PyObject *__pyx_r = NULL;
8889 : __Pyx_RefNannyDeclarations
8890 0 : __Pyx_memviewslice *__pyx_t_1;
8891 0 : PyObject *__pyx_t_2 = NULL;
8892 0 : int __pyx_t_3;
8893 0 : int __pyx_t_4;
8894 0 : int __pyx_t_5;
8895 0 : int __pyx_lineno = 0;
8896 0 : const char *__pyx_filename = NULL;
8897 0 : int __pyx_clineno = 0;
8898 0 : __Pyx_RefNannySetupContext("setitem_slice_assignment", 1);
8899 :
8900 : /* "View.MemoryView":448
8901 : * cdef __Pyx_memviewslice dst_slice
8902 : * cdef __Pyx_memviewslice src_slice
8903 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0] # <<<<<<<<<<<<<<
8904 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
8905 : *
8906 : */
8907 0 : if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 448, __pyx_L1_error)
8908 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 448, __pyx_L1_error)
8909 0 : __pyx_v_msrc = (__pyx_t_1[0]);
8910 :
8911 : /* "View.MemoryView":449
8912 : * cdef __Pyx_memviewslice src_slice
8913 : * cdef __Pyx_memviewslice msrc = get_slice_from_memview(src, &src_slice)[0]
8914 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0] # <<<<<<<<<<<<<<
8915 : *
8916 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
8917 : */
8918 0 : if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 449, __pyx_L1_error)
8919 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 449, __pyx_L1_error)
8920 0 : __pyx_v_mdst = (__pyx_t_1[0]);
8921 :
8922 : /* "View.MemoryView":451
8923 : * cdef __Pyx_memviewslice mdst = get_slice_from_memview(dst, &dst_slice)[0]
8924 : *
8925 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
8926 : *
8927 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
8928 : */
8929 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
8930 0 : __Pyx_GOTREF(__pyx_t_2);
8931 0 : __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
8932 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8933 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 451, __pyx_L1_error)
8934 0 : __Pyx_GOTREF(__pyx_t_2);
8935 0 : __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 451, __pyx_L1_error)
8936 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8937 0 : __pyx_t_5 = __pyx_memoryview_copy_contents(__pyx_v_msrc, __pyx_v_mdst, __pyx_t_3, __pyx_t_4, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 451, __pyx_L1_error)
8938 :
8939 : /* "View.MemoryView":445
8940 : * return obj
8941 : *
8942 : * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
8943 : * cdef __Pyx_memviewslice dst_slice
8944 : * cdef __Pyx_memviewslice src_slice
8945 : */
8946 :
8947 : /* function exit code */
8948 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8949 0 : goto __pyx_L0;
8950 0 : __pyx_L1_error:;
8951 0 : __Pyx_XDECREF(__pyx_t_2);
8952 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
8953 0 : __pyx_r = 0;
8954 0 : __pyx_L0:;
8955 0 : __Pyx_XGIVEREF(__pyx_r);
8956 0 : __Pyx_RefNannyFinishContext();
8957 0 : return __pyx_r;
8958 : }
8959 :
8960 : /* "View.MemoryView":453
8961 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
8962 : *
8963 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
8964 : * cdef int array[128]
8965 : * cdef void *tmp = NULL
8966 : */
8967 :
8968 0 : static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
8969 0 : int __pyx_v_array[0x80];
8970 0 : void *__pyx_v_tmp;
8971 0 : void *__pyx_v_item;
8972 0 : __Pyx_memviewslice *__pyx_v_dst_slice;
8973 0 : __Pyx_memviewslice __pyx_v_tmp_slice;
8974 0 : PyObject *__pyx_r = NULL;
8975 : __Pyx_RefNannyDeclarations
8976 0 : __Pyx_memviewslice *__pyx_t_1;
8977 0 : int __pyx_t_2;
8978 0 : PyObject *__pyx_t_3 = NULL;
8979 0 : int __pyx_t_4;
8980 0 : int __pyx_t_5;
8981 0 : char const *__pyx_t_6;
8982 0 : PyObject *__pyx_t_7 = NULL;
8983 0 : PyObject *__pyx_t_8 = NULL;
8984 0 : PyObject *__pyx_t_9 = NULL;
8985 0 : PyObject *__pyx_t_10 = NULL;
8986 0 : PyObject *__pyx_t_11 = NULL;
8987 0 : PyObject *__pyx_t_12 = NULL;
8988 0 : int __pyx_lineno = 0;
8989 0 : const char *__pyx_filename = NULL;
8990 0 : int __pyx_clineno = 0;
8991 0 : __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 1);
8992 :
8993 : /* "View.MemoryView":455
8994 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
8995 : * cdef int array[128]
8996 : * cdef void *tmp = NULL # <<<<<<<<<<<<<<
8997 : * cdef void *item
8998 : *
8999 : */
9000 0 : __pyx_v_tmp = NULL;
9001 :
9002 : /* "View.MemoryView":460
9003 : * cdef __Pyx_memviewslice *dst_slice
9004 : * cdef __Pyx_memviewslice tmp_slice
9005 : * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
9006 : *
9007 : * if <size_t>self.view.itemsize > sizeof(array):
9008 : */
9009 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 460, __pyx_L1_error)
9010 0 : __pyx_v_dst_slice = __pyx_t_1;
9011 :
9012 : /* "View.MemoryView":462
9013 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9014 : *
9015 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9016 : * tmp = PyMem_Malloc(self.view.itemsize)
9017 : * if tmp == NULL:
9018 : */
9019 0 : __pyx_t_2 = (((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array)));
9020 0 : if (__pyx_t_2) {
9021 :
9022 : /* "View.MemoryView":463
9023 : *
9024 : * if <size_t>self.view.itemsize > sizeof(array):
9025 : * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
9026 : * if tmp == NULL:
9027 : * raise MemoryError
9028 : */
9029 0 : __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
9030 :
9031 : /* "View.MemoryView":464
9032 : * if <size_t>self.view.itemsize > sizeof(array):
9033 : * tmp = PyMem_Malloc(self.view.itemsize)
9034 : * if tmp == NULL: # <<<<<<<<<<<<<<
9035 : * raise MemoryError
9036 : * item = tmp
9037 : */
9038 0 : __pyx_t_2 = (__pyx_v_tmp == NULL);
9039 0 : if (unlikely(__pyx_t_2)) {
9040 :
9041 : /* "View.MemoryView":465
9042 : * tmp = PyMem_Malloc(self.view.itemsize)
9043 : * if tmp == NULL:
9044 : * raise MemoryError # <<<<<<<<<<<<<<
9045 : * item = tmp
9046 : * else:
9047 : */
9048 0 : PyErr_NoMemory(); __PYX_ERR(1, 465, __pyx_L1_error)
9049 :
9050 : /* "View.MemoryView":464
9051 : * if <size_t>self.view.itemsize > sizeof(array):
9052 : * tmp = PyMem_Malloc(self.view.itemsize)
9053 : * if tmp == NULL: # <<<<<<<<<<<<<<
9054 : * raise MemoryError
9055 : * item = tmp
9056 : */
9057 : }
9058 :
9059 : /* "View.MemoryView":466
9060 : * if tmp == NULL:
9061 : * raise MemoryError
9062 : * item = tmp # <<<<<<<<<<<<<<
9063 : * else:
9064 : * item = <void *> array
9065 : */
9066 0 : __pyx_v_item = __pyx_v_tmp;
9067 :
9068 : /* "View.MemoryView":462
9069 : * dst_slice = get_slice_from_memview(dst, &tmp_slice)
9070 : *
9071 : * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
9072 : * tmp = PyMem_Malloc(self.view.itemsize)
9073 : * if tmp == NULL:
9074 : */
9075 0 : goto __pyx_L3;
9076 : }
9077 :
9078 : /* "View.MemoryView":468
9079 : * item = tmp
9080 : * else:
9081 : * item = <void *> array # <<<<<<<<<<<<<<
9082 : *
9083 : * try:
9084 : */
9085 : /*else*/ {
9086 : __pyx_v_item = ((void *)__pyx_v_array);
9087 : }
9088 0 : __pyx_L3:;
9089 :
9090 : /* "View.MemoryView":470
9091 : * item = <void *> array
9092 : *
9093 : * try: # <<<<<<<<<<<<<<
9094 : * if self.dtype_is_object:
9095 : * (<PyObject **> item)[0] = <PyObject *> value
9096 : */
9097 : /*try:*/ {
9098 :
9099 : /* "View.MemoryView":471
9100 : *
9101 : * try:
9102 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9103 : * (<PyObject **> item)[0] = <PyObject *> value
9104 : * else:
9105 : */
9106 0 : if (__pyx_v_self->dtype_is_object) {
9107 :
9108 : /* "View.MemoryView":472
9109 : * try:
9110 : * if self.dtype_is_object:
9111 : * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
9112 : * else:
9113 : * self.assign_item_from_object(<char *> item, value)
9114 : */
9115 0 : (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
9116 :
9117 : /* "View.MemoryView":471
9118 : *
9119 : * try:
9120 : * if self.dtype_is_object: # <<<<<<<<<<<<<<
9121 : * (<PyObject **> item)[0] = <PyObject *> value
9122 : * else:
9123 : */
9124 0 : goto __pyx_L8;
9125 : }
9126 :
9127 : /* "View.MemoryView":474
9128 : * (<PyObject **> item)[0] = <PyObject *> value
9129 : * else:
9130 : * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
9131 : *
9132 : *
9133 : */
9134 : /*else*/ {
9135 0 : __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 474, __pyx_L6_error)
9136 0 : __Pyx_GOTREF(__pyx_t_3);
9137 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9138 : }
9139 0 : __pyx_L8:;
9140 :
9141 : /* "View.MemoryView":478
9142 : *
9143 : *
9144 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9145 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9146 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9147 : */
9148 0 : __pyx_t_2 = (__pyx_v_self->view.suboffsets != NULL);
9149 0 : if (__pyx_t_2) {
9150 :
9151 : /* "View.MemoryView":479
9152 : *
9153 : * if self.view.suboffsets != NULL:
9154 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
9155 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9156 : * item, self.dtype_is_object)
9157 : */
9158 0 : __pyx_t_4 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 479, __pyx_L6_error)
9159 :
9160 : /* "View.MemoryView":478
9161 : *
9162 : *
9163 : * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
9164 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9165 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
9166 : */
9167 : }
9168 :
9169 : /* "View.MemoryView":480
9170 : * if self.view.suboffsets != NULL:
9171 : * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
9172 : * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
9173 : * item, self.dtype_is_object)
9174 : * finally:
9175 : */
9176 0 : __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
9177 : }
9178 :
9179 : /* "View.MemoryView":483
9180 : * item, self.dtype_is_object)
9181 : * finally:
9182 : * PyMem_Free(tmp) # <<<<<<<<<<<<<<
9183 : *
9184 : * cdef setitem_indexed(self, index, value):
9185 : */
9186 : /*finally:*/ {
9187 : /*normal exit:*/{
9188 0 : PyMem_Free(__pyx_v_tmp);
9189 0 : goto __pyx_L7;
9190 : }
9191 0 : __pyx_L6_error:;
9192 : /*exception exit:*/{
9193 0 : __Pyx_PyThreadState_declare
9194 0 : __Pyx_PyThreadState_assign
9195 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9196 0 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9197 0 : if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
9198 0 : if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
9199 0 : __Pyx_XGOTREF(__pyx_t_7);
9200 0 : __Pyx_XGOTREF(__pyx_t_8);
9201 0 : __Pyx_XGOTREF(__pyx_t_9);
9202 0 : __Pyx_XGOTREF(__pyx_t_10);
9203 0 : __Pyx_XGOTREF(__pyx_t_11);
9204 0 : __Pyx_XGOTREF(__pyx_t_12);
9205 0 : __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
9206 : {
9207 0 : PyMem_Free(__pyx_v_tmp);
9208 : }
9209 0 : if (PY_MAJOR_VERSION >= 3) {
9210 0 : __Pyx_XGIVEREF(__pyx_t_10);
9211 0 : __Pyx_XGIVEREF(__pyx_t_11);
9212 0 : __Pyx_XGIVEREF(__pyx_t_12);
9213 0 : __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
9214 : }
9215 0 : __Pyx_XGIVEREF(__pyx_t_7);
9216 0 : __Pyx_XGIVEREF(__pyx_t_8);
9217 0 : __Pyx_XGIVEREF(__pyx_t_9);
9218 0 : __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
9219 0 : __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
9220 0 : __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
9221 0 : goto __pyx_L1_error;
9222 : }
9223 0 : __pyx_L7:;
9224 : }
9225 :
9226 : /* "View.MemoryView":453
9227 : * memoryview_copy_contents(msrc, mdst, src.ndim, dst.ndim, self.dtype_is_object)
9228 : *
9229 : * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
9230 : * cdef int array[128]
9231 : * cdef void *tmp = NULL
9232 : */
9233 :
9234 : /* function exit code */
9235 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9236 0 : goto __pyx_L0;
9237 0 : __pyx_L1_error:;
9238 0 : __Pyx_XDECREF(__pyx_t_3);
9239 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
9240 0 : __pyx_r = 0;
9241 0 : __pyx_L0:;
9242 0 : __Pyx_XGIVEREF(__pyx_r);
9243 0 : __Pyx_RefNannyFinishContext();
9244 0 : return __pyx_r;
9245 : }
9246 :
9247 : /* "View.MemoryView":485
9248 : * PyMem_Free(tmp)
9249 : *
9250 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9251 : * cdef char *itemp = self.get_item_pointer(index)
9252 : * self.assign_item_from_object(itemp, value)
9253 : */
9254 :
9255 0 : static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
9256 0 : char *__pyx_v_itemp;
9257 0 : PyObject *__pyx_r = NULL;
9258 : __Pyx_RefNannyDeclarations
9259 0 : char *__pyx_t_1;
9260 0 : PyObject *__pyx_t_2 = NULL;
9261 0 : int __pyx_lineno = 0;
9262 0 : const char *__pyx_filename = NULL;
9263 0 : int __pyx_clineno = 0;
9264 0 : __Pyx_RefNannySetupContext("setitem_indexed", 1);
9265 :
9266 : /* "View.MemoryView":486
9267 : *
9268 : * cdef setitem_indexed(self, index, value):
9269 : * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
9270 : * self.assign_item_from_object(itemp, value)
9271 : *
9272 : */
9273 0 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 486, __pyx_L1_error)
9274 0 : __pyx_v_itemp = __pyx_t_1;
9275 :
9276 : /* "View.MemoryView":487
9277 : * cdef setitem_indexed(self, index, value):
9278 : * cdef char *itemp = self.get_item_pointer(index)
9279 : * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
9280 : *
9281 : * cdef convert_item_to_object(self, char *itemp):
9282 : */
9283 0 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 487, __pyx_L1_error)
9284 0 : __Pyx_GOTREF(__pyx_t_2);
9285 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9286 :
9287 : /* "View.MemoryView":485
9288 : * PyMem_Free(tmp)
9289 : *
9290 : * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
9291 : * cdef char *itemp = self.get_item_pointer(index)
9292 : * self.assign_item_from_object(itemp, value)
9293 : */
9294 :
9295 : /* function exit code */
9296 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9297 0 : goto __pyx_L0;
9298 0 : __pyx_L1_error:;
9299 0 : __Pyx_XDECREF(__pyx_t_2);
9300 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
9301 0 : __pyx_r = 0;
9302 0 : __pyx_L0:;
9303 0 : __Pyx_XGIVEREF(__pyx_r);
9304 0 : __Pyx_RefNannyFinishContext();
9305 0 : return __pyx_r;
9306 : }
9307 :
9308 : /* "View.MemoryView":489
9309 : * self.assign_item_from_object(itemp, value)
9310 : *
9311 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9312 : * """Only used if instantiated manually by the user, or if Cython doesn't
9313 : * know how to convert the type"""
9314 : */
9315 :
9316 0 : static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
9317 0 : PyObject *__pyx_v_struct = NULL;
9318 0 : PyObject *__pyx_v_bytesitem = 0;
9319 0 : PyObject *__pyx_v_result = NULL;
9320 0 : PyObject *__pyx_r = NULL;
9321 : __Pyx_RefNannyDeclarations
9322 0 : PyObject *__pyx_t_1 = NULL;
9323 0 : PyObject *__pyx_t_2 = NULL;
9324 0 : PyObject *__pyx_t_3 = NULL;
9325 0 : PyObject *__pyx_t_4 = NULL;
9326 0 : PyObject *__pyx_t_5 = NULL;
9327 0 : PyObject *__pyx_t_6 = NULL;
9328 0 : PyObject *__pyx_t_7 = NULL;
9329 0 : unsigned int __pyx_t_8;
9330 0 : Py_ssize_t __pyx_t_9;
9331 0 : int __pyx_t_10;
9332 0 : int __pyx_t_11;
9333 0 : int __pyx_lineno = 0;
9334 0 : const char *__pyx_filename = NULL;
9335 0 : int __pyx_clineno = 0;
9336 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
9337 :
9338 : /* "View.MemoryView":492
9339 : * """Only used if instantiated manually by the user, or if Cython doesn't
9340 : * know how to convert the type"""
9341 : * import struct # <<<<<<<<<<<<<<
9342 : * cdef bytes bytesitem
9343 : *
9344 : */
9345 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 492, __pyx_L1_error)
9346 0 : __Pyx_GOTREF(__pyx_t_1);
9347 0 : __pyx_v_struct = __pyx_t_1;
9348 0 : __pyx_t_1 = 0;
9349 :
9350 : /* "View.MemoryView":495
9351 : * cdef bytes bytesitem
9352 : *
9353 : * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
9354 : * try:
9355 : * result = struct.unpack(self.view.format, bytesitem)
9356 : */
9357 0 : __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
9358 0 : __Pyx_GOTREF(__pyx_t_1);
9359 0 : __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
9360 0 : __pyx_t_1 = 0;
9361 :
9362 : /* "View.MemoryView":496
9363 : *
9364 : * bytesitem = itemp[:self.view.itemsize]
9365 : * try: # <<<<<<<<<<<<<<
9366 : * result = struct.unpack(self.view.format, bytesitem)
9367 : * except struct.error:
9368 : */
9369 : {
9370 0 : __Pyx_PyThreadState_declare
9371 0 : __Pyx_PyThreadState_assign
9372 0 : __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
9373 0 : __Pyx_XGOTREF(__pyx_t_2);
9374 0 : __Pyx_XGOTREF(__pyx_t_3);
9375 0 : __Pyx_XGOTREF(__pyx_t_4);
9376 : /*try:*/ {
9377 :
9378 : /* "View.MemoryView":497
9379 : * bytesitem = itemp[:self.view.itemsize]
9380 : * try:
9381 : * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
9382 : * except struct.error:
9383 : * raise ValueError, "Unable to convert item to object"
9384 : */
9385 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 497, __pyx_L3_error)
9386 0 : __Pyx_GOTREF(__pyx_t_5);
9387 0 : __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 497, __pyx_L3_error)
9388 0 : __Pyx_GOTREF(__pyx_t_6);
9389 0 : __pyx_t_7 = NULL;
9390 0 : __pyx_t_8 = 0;
9391 : #if CYTHON_UNPACK_METHODS
9392 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
9393 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
9394 0 : if (likely(__pyx_t_7)) {
9395 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9396 0 : __Pyx_INCREF(__pyx_t_7);
9397 0 : __Pyx_INCREF(function);
9398 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
9399 : __pyx_t_8 = 1;
9400 : }
9401 : }
9402 : #endif
9403 : {
9404 0 : PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
9405 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
9406 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9407 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9408 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L3_error)
9409 0 : __Pyx_GOTREF(__pyx_t_1);
9410 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9411 : }
9412 0 : __pyx_v_result = __pyx_t_1;
9413 0 : __pyx_t_1 = 0;
9414 :
9415 : /* "View.MemoryView":496
9416 : *
9417 : * bytesitem = itemp[:self.view.itemsize]
9418 : * try: # <<<<<<<<<<<<<<
9419 : * result = struct.unpack(self.view.format, bytesitem)
9420 : * except struct.error:
9421 : */
9422 : }
9423 :
9424 : /* "View.MemoryView":501
9425 : * raise ValueError, "Unable to convert item to object"
9426 : * else:
9427 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9428 : * return result[0]
9429 : * return result
9430 : */
9431 : /*else:*/ {
9432 0 : __pyx_t_9 = __Pyx_ssize_strlen(__pyx_v_self->view.format); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(1, 501, __pyx_L5_except_error)
9433 0 : __pyx_t_10 = (__pyx_t_9 == 1);
9434 0 : if (__pyx_t_10) {
9435 :
9436 : /* "View.MemoryView":502
9437 : * else:
9438 : * if len(self.view.format) == 1:
9439 : * return result[0] # <<<<<<<<<<<<<<
9440 : * return result
9441 : *
9442 : */
9443 0 : __Pyx_XDECREF(__pyx_r);
9444 0 : __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 502, __pyx_L5_except_error)
9445 0 : __Pyx_GOTREF(__pyx_t_1);
9446 0 : __pyx_r = __pyx_t_1;
9447 0 : __pyx_t_1 = 0;
9448 0 : goto __pyx_L6_except_return;
9449 :
9450 : /* "View.MemoryView":501
9451 : * raise ValueError, "Unable to convert item to object"
9452 : * else:
9453 : * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
9454 : * return result[0]
9455 : * return result
9456 : */
9457 : }
9458 :
9459 : /* "View.MemoryView":503
9460 : * if len(self.view.format) == 1:
9461 : * return result[0]
9462 : * return result # <<<<<<<<<<<<<<
9463 : *
9464 : * cdef assign_item_from_object(self, char *itemp, object value):
9465 : */
9466 0 : __Pyx_XDECREF(__pyx_r);
9467 0 : __Pyx_INCREF(__pyx_v_result);
9468 0 : __pyx_r = __pyx_v_result;
9469 0 : goto __pyx_L6_except_return;
9470 : }
9471 0 : __pyx_L3_error:;
9472 0 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
9473 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9474 0 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9475 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
9476 :
9477 : /* "View.MemoryView":498
9478 : * try:
9479 : * result = struct.unpack(self.view.format, bytesitem)
9480 : * except struct.error: # <<<<<<<<<<<<<<
9481 : * raise ValueError, "Unable to convert item to object"
9482 : * else:
9483 : */
9484 0 : __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6);
9485 0 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 498, __pyx_L5_except_error)
9486 0 : __Pyx_GOTREF(__pyx_t_7);
9487 0 : __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_7);
9488 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9489 0 : __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_6);
9490 0 : __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
9491 0 : if (__pyx_t_11) {
9492 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9493 0 : if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 498, __pyx_L5_except_error)
9494 0 : __Pyx_XGOTREF(__pyx_t_6);
9495 0 : __Pyx_XGOTREF(__pyx_t_5);
9496 0 : __Pyx_XGOTREF(__pyx_t_1);
9497 :
9498 : /* "View.MemoryView":499
9499 : * result = struct.unpack(self.view.format, bytesitem)
9500 : * except struct.error:
9501 : * raise ValueError, "Unable to convert item to object" # <<<<<<<<<<<<<<
9502 : * else:
9503 : * if len(self.view.format) == 1:
9504 : */
9505 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Unable_to_convert_item_to_object, 0, 0);
9506 0 : __PYX_ERR(1, 499, __pyx_L5_except_error)
9507 : }
9508 0 : goto __pyx_L5_except_error;
9509 :
9510 : /* "View.MemoryView":496
9511 : *
9512 : * bytesitem = itemp[:self.view.itemsize]
9513 : * try: # <<<<<<<<<<<<<<
9514 : * result = struct.unpack(self.view.format, bytesitem)
9515 : * except struct.error:
9516 : */
9517 0 : __pyx_L5_except_error:;
9518 0 : __Pyx_XGIVEREF(__pyx_t_2);
9519 0 : __Pyx_XGIVEREF(__pyx_t_3);
9520 0 : __Pyx_XGIVEREF(__pyx_t_4);
9521 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9522 0 : goto __pyx_L1_error;
9523 0 : __pyx_L6_except_return:;
9524 0 : __Pyx_XGIVEREF(__pyx_t_2);
9525 0 : __Pyx_XGIVEREF(__pyx_t_3);
9526 0 : __Pyx_XGIVEREF(__pyx_t_4);
9527 0 : __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
9528 0 : goto __pyx_L0;
9529 : }
9530 :
9531 : /* "View.MemoryView":489
9532 : * self.assign_item_from_object(itemp, value)
9533 : *
9534 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
9535 : * """Only used if instantiated manually by the user, or if Cython doesn't
9536 : * know how to convert the type"""
9537 : */
9538 :
9539 : /* function exit code */
9540 0 : __pyx_L1_error:;
9541 0 : __Pyx_XDECREF(__pyx_t_1);
9542 0 : __Pyx_XDECREF(__pyx_t_5);
9543 0 : __Pyx_XDECREF(__pyx_t_6);
9544 0 : __Pyx_XDECREF(__pyx_t_7);
9545 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9546 0 : __pyx_r = 0;
9547 0 : __pyx_L0:;
9548 0 : __Pyx_XDECREF(__pyx_v_struct);
9549 0 : __Pyx_XDECREF(__pyx_v_bytesitem);
9550 0 : __Pyx_XDECREF(__pyx_v_result);
9551 0 : __Pyx_XGIVEREF(__pyx_r);
9552 0 : __Pyx_RefNannyFinishContext();
9553 0 : return __pyx_r;
9554 : }
9555 :
9556 : /* "View.MemoryView":505
9557 : * return result
9558 : *
9559 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9560 : * """Only used if instantiated manually by the user, or if Cython doesn't
9561 : * know how to convert the type"""
9562 : */
9563 :
9564 0 : static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
9565 0 : PyObject *__pyx_v_struct = NULL;
9566 0 : char __pyx_v_c;
9567 0 : PyObject *__pyx_v_bytesvalue = 0;
9568 0 : Py_ssize_t __pyx_v_i;
9569 0 : PyObject *__pyx_r = NULL;
9570 : __Pyx_RefNannyDeclarations
9571 0 : PyObject *__pyx_t_1 = NULL;
9572 0 : int __pyx_t_2;
9573 0 : PyObject *__pyx_t_3 = NULL;
9574 0 : PyObject *__pyx_t_4 = NULL;
9575 0 : PyObject *__pyx_t_5 = NULL;
9576 0 : unsigned int __pyx_t_6;
9577 0 : Py_ssize_t __pyx_t_7;
9578 0 : PyObject *__pyx_t_8 = NULL;
9579 0 : char *__pyx_t_9;
9580 0 : char *__pyx_t_10;
9581 0 : char *__pyx_t_11;
9582 0 : char *__pyx_t_12;
9583 0 : int __pyx_lineno = 0;
9584 0 : const char *__pyx_filename = NULL;
9585 0 : int __pyx_clineno = 0;
9586 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
9587 :
9588 : /* "View.MemoryView":508
9589 : * """Only used if instantiated manually by the user, or if Cython doesn't
9590 : * know how to convert the type"""
9591 : * import struct # <<<<<<<<<<<<<<
9592 : * cdef char c
9593 : * cdef bytes bytesvalue
9594 : */
9595 0 : __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
9596 0 : __Pyx_GOTREF(__pyx_t_1);
9597 0 : __pyx_v_struct = __pyx_t_1;
9598 0 : __pyx_t_1 = 0;
9599 :
9600 : /* "View.MemoryView":513
9601 : * cdef Py_ssize_t i
9602 : *
9603 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9604 : * bytesvalue = struct.pack(self.view.format, *value)
9605 : * else:
9606 : */
9607 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_value);
9608 0 : if (__pyx_t_2) {
9609 :
9610 : /* "View.MemoryView":514
9611 : *
9612 : * if isinstance(value, tuple):
9613 : * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
9614 : * else:
9615 : * bytesvalue = struct.pack(self.view.format, value)
9616 : */
9617 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
9618 0 : __Pyx_GOTREF(__pyx_t_1);
9619 0 : __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9620 0 : __Pyx_GOTREF(__pyx_t_3);
9621 0 : __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 514, __pyx_L1_error)
9622 0 : __Pyx_GOTREF(__pyx_t_4);
9623 0 : __Pyx_GIVEREF(__pyx_t_3);
9624 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error);
9625 0 : __pyx_t_3 = 0;
9626 0 : __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9627 0 : __Pyx_GOTREF(__pyx_t_3);
9628 0 : __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 514, __pyx_L1_error)
9629 0 : __Pyx_GOTREF(__pyx_t_5);
9630 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9631 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9632 0 : __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 514, __pyx_L1_error)
9633 0 : __Pyx_GOTREF(__pyx_t_3);
9634 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9635 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9636 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 514, __pyx_L1_error)
9637 0 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
9638 0 : __pyx_t_3 = 0;
9639 :
9640 : /* "View.MemoryView":513
9641 : * cdef Py_ssize_t i
9642 : *
9643 : * if isinstance(value, tuple): # <<<<<<<<<<<<<<
9644 : * bytesvalue = struct.pack(self.view.format, *value)
9645 : * else:
9646 : */
9647 0 : goto __pyx_L3;
9648 : }
9649 :
9650 : /* "View.MemoryView":516
9651 : * bytesvalue = struct.pack(self.view.format, *value)
9652 : * else:
9653 : * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
9654 : *
9655 : * for i, c in enumerate(bytesvalue):
9656 : */
9657 : /*else*/ {
9658 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 516, __pyx_L1_error)
9659 0 : __Pyx_GOTREF(__pyx_t_5);
9660 0 : __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
9661 0 : __Pyx_GOTREF(__pyx_t_1);
9662 0 : __pyx_t_4 = NULL;
9663 0 : __pyx_t_6 = 0;
9664 : #if CYTHON_UNPACK_METHODS
9665 0 : if (likely(PyMethod_Check(__pyx_t_5))) {
9666 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
9667 0 : if (likely(__pyx_t_4)) {
9668 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9669 0 : __Pyx_INCREF(__pyx_t_4);
9670 0 : __Pyx_INCREF(function);
9671 0 : __Pyx_DECREF_SET(__pyx_t_5, function);
9672 : __pyx_t_6 = 1;
9673 : }
9674 : }
9675 : #endif
9676 : {
9677 0 : PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_1, __pyx_v_value};
9678 0 : __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6);
9679 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9680 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9681 0 : if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 516, __pyx_L1_error)
9682 0 : __Pyx_GOTREF(__pyx_t_3);
9683 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9684 : }
9685 0 : if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_3))) __PYX_ERR(1, 516, __pyx_L1_error)
9686 : __pyx_v_bytesvalue = ((PyObject*)__pyx_t_3);
9687 : __pyx_t_3 = 0;
9688 : }
9689 0 : __pyx_L3:;
9690 :
9691 : /* "View.MemoryView":518
9692 : * bytesvalue = struct.pack(self.view.format, value)
9693 : *
9694 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9695 : * itemp[i] = c
9696 : *
9697 : */
9698 0 : __pyx_t_7 = 0;
9699 0 : if (unlikely(__pyx_v_bytesvalue == Py_None)) {
9700 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
9701 0 : __PYX_ERR(1, 518, __pyx_L1_error)
9702 : }
9703 0 : __Pyx_INCREF(__pyx_v_bytesvalue);
9704 0 : __pyx_t_8 = __pyx_v_bytesvalue;
9705 0 : __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
9706 0 : __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
9707 0 : for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
9708 0 : __pyx_t_9 = __pyx_t_12;
9709 0 : __pyx_v_c = (__pyx_t_9[0]);
9710 :
9711 : /* "View.MemoryView":519
9712 : *
9713 : * for i, c in enumerate(bytesvalue):
9714 : * itemp[i] = c # <<<<<<<<<<<<<<
9715 : *
9716 : * @cname('getbuffer')
9717 : */
9718 0 : __pyx_v_i = __pyx_t_7;
9719 :
9720 : /* "View.MemoryView":518
9721 : * bytesvalue = struct.pack(self.view.format, value)
9722 : *
9723 : * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
9724 : * itemp[i] = c
9725 : *
9726 : */
9727 0 : __pyx_t_7 = (__pyx_t_7 + 1);
9728 :
9729 : /* "View.MemoryView":519
9730 : *
9731 : * for i, c in enumerate(bytesvalue):
9732 : * itemp[i] = c # <<<<<<<<<<<<<<
9733 : *
9734 : * @cname('getbuffer')
9735 : */
9736 0 : (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
9737 : }
9738 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
9739 :
9740 : /* "View.MemoryView":505
9741 : * return result
9742 : *
9743 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
9744 : * """Only used if instantiated manually by the user, or if Cython doesn't
9745 : * know how to convert the type"""
9746 : */
9747 :
9748 : /* function exit code */
9749 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9750 0 : goto __pyx_L0;
9751 0 : __pyx_L1_error:;
9752 0 : __Pyx_XDECREF(__pyx_t_1);
9753 0 : __Pyx_XDECREF(__pyx_t_3);
9754 0 : __Pyx_XDECREF(__pyx_t_4);
9755 0 : __Pyx_XDECREF(__pyx_t_5);
9756 0 : __Pyx_XDECREF(__pyx_t_8);
9757 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
9758 0 : __pyx_r = 0;
9759 0 : __pyx_L0:;
9760 0 : __Pyx_XDECREF(__pyx_v_struct);
9761 0 : __Pyx_XDECREF(__pyx_v_bytesvalue);
9762 0 : __Pyx_XGIVEREF(__pyx_r);
9763 0 : __Pyx_RefNannyFinishContext();
9764 0 : return __pyx_r;
9765 : }
9766 :
9767 : /* "View.MemoryView":521
9768 : * itemp[i] = c
9769 : *
9770 : * @cname('getbuffer') # <<<<<<<<<<<<<<
9771 : * def __getbuffer__(self, Py_buffer *info, int flags):
9772 : * if flags & PyBUF_WRITABLE and self.view.readonly:
9773 : */
9774 :
9775 : /* Python wrapper */
9776 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
9777 4 : CYTHON_UNUSED static int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9778 4 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
9779 4 : int __pyx_r;
9780 : __Pyx_RefNannyDeclarations
9781 4 : __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
9782 4 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
9783 4 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
9784 :
9785 : /* function exit code */
9786 4 : __Pyx_RefNannyFinishContext();
9787 4 : return __pyx_r;
9788 : }
9789 :
9790 4 : static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
9791 4 : int __pyx_r;
9792 : __Pyx_RefNannyDeclarations
9793 4 : int __pyx_t_1;
9794 4 : int __pyx_t_2;
9795 4 : Py_ssize_t *__pyx_t_3;
9796 4 : char *__pyx_t_4;
9797 4 : void *__pyx_t_5;
9798 4 : int __pyx_t_6;
9799 4 : Py_ssize_t __pyx_t_7;
9800 4 : int __pyx_lineno = 0;
9801 4 : const char *__pyx_filename = NULL;
9802 4 : int __pyx_clineno = 0;
9803 4 : if (unlikely(__pyx_v_info == NULL)) {
9804 0 : PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
9805 0 : return -1;
9806 : }
9807 4 : __Pyx_RefNannySetupContext("__getbuffer__", 0);
9808 4 : __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
9809 4 : __Pyx_GIVEREF(__pyx_v_info->obj);
9810 :
9811 : /* "View.MemoryView":523
9812 : * @cname('getbuffer')
9813 : * def __getbuffer__(self, Py_buffer *info, int flags):
9814 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
9815 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
9816 : *
9817 : */
9818 4 : __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
9819 4 : if (__pyx_t_2) {
9820 0 : } else {
9821 4 : __pyx_t_1 = __pyx_t_2;
9822 4 : goto __pyx_L4_bool_binop_done;
9823 : }
9824 0 : __pyx_t_1 = __pyx_v_self->view.readonly;
9825 4 : __pyx_L4_bool_binop_done:;
9826 4 : if (unlikely(__pyx_t_1)) {
9827 :
9828 : /* "View.MemoryView":524
9829 : * def __getbuffer__(self, Py_buffer *info, int flags):
9830 : * if flags & PyBUF_WRITABLE and self.view.readonly:
9831 : * raise ValueError, "Cannot create writable memory view from read-only memoryview" # <<<<<<<<<<<<<<
9832 : *
9833 : * if flags & PyBUF_ND:
9834 : */
9835 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Cannot_create_writable_memory_vi, 0, 0);
9836 0 : __PYX_ERR(1, 524, __pyx_L1_error)
9837 :
9838 : /* "View.MemoryView":523
9839 : * @cname('getbuffer')
9840 : * def __getbuffer__(self, Py_buffer *info, int flags):
9841 : * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
9842 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
9843 : *
9844 : */
9845 : }
9846 :
9847 : /* "View.MemoryView":526
9848 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
9849 : *
9850 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9851 : * info.shape = self.view.shape
9852 : * else:
9853 : */
9854 4 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
9855 4 : if (__pyx_t_1) {
9856 :
9857 : /* "View.MemoryView":527
9858 : *
9859 : * if flags & PyBUF_ND:
9860 : * info.shape = self.view.shape # <<<<<<<<<<<<<<
9861 : * else:
9862 : * info.shape = NULL
9863 : */
9864 4 : __pyx_t_3 = __pyx_v_self->view.shape;
9865 4 : __pyx_v_info->shape = __pyx_t_3;
9866 :
9867 : /* "View.MemoryView":526
9868 : * raise ValueError, "Cannot create writable memory view from read-only memoryview"
9869 : *
9870 : * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
9871 : * info.shape = self.view.shape
9872 : * else:
9873 : */
9874 4 : goto __pyx_L6;
9875 : }
9876 :
9877 : /* "View.MemoryView":529
9878 : * info.shape = self.view.shape
9879 : * else:
9880 : * info.shape = NULL # <<<<<<<<<<<<<<
9881 : *
9882 : * if flags & PyBUF_STRIDES:
9883 : */
9884 : /*else*/ {
9885 0 : __pyx_v_info->shape = NULL;
9886 : }
9887 4 : __pyx_L6:;
9888 :
9889 : /* "View.MemoryView":531
9890 : * info.shape = NULL
9891 : *
9892 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
9893 : * info.strides = self.view.strides
9894 : * else:
9895 : */
9896 4 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
9897 4 : if (__pyx_t_1) {
9898 :
9899 : /* "View.MemoryView":532
9900 : *
9901 : * if flags & PyBUF_STRIDES:
9902 : * info.strides = self.view.strides # <<<<<<<<<<<<<<
9903 : * else:
9904 : * info.strides = NULL
9905 : */
9906 4 : __pyx_t_3 = __pyx_v_self->view.strides;
9907 4 : __pyx_v_info->strides = __pyx_t_3;
9908 :
9909 : /* "View.MemoryView":531
9910 : * info.shape = NULL
9911 : *
9912 : * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
9913 : * info.strides = self.view.strides
9914 : * else:
9915 : */
9916 4 : goto __pyx_L7;
9917 : }
9918 :
9919 : /* "View.MemoryView":534
9920 : * info.strides = self.view.strides
9921 : * else:
9922 : * info.strides = NULL # <<<<<<<<<<<<<<
9923 : *
9924 : * if flags & PyBUF_INDIRECT:
9925 : */
9926 : /*else*/ {
9927 0 : __pyx_v_info->strides = NULL;
9928 : }
9929 4 : __pyx_L7:;
9930 :
9931 : /* "View.MemoryView":536
9932 : * info.strides = NULL
9933 : *
9934 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
9935 : * info.suboffsets = self.view.suboffsets
9936 : * else:
9937 : */
9938 4 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
9939 4 : if (__pyx_t_1) {
9940 :
9941 : /* "View.MemoryView":537
9942 : *
9943 : * if flags & PyBUF_INDIRECT:
9944 : * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
9945 : * else:
9946 : * info.suboffsets = NULL
9947 : */
9948 4 : __pyx_t_3 = __pyx_v_self->view.suboffsets;
9949 4 : __pyx_v_info->suboffsets = __pyx_t_3;
9950 :
9951 : /* "View.MemoryView":536
9952 : * info.strides = NULL
9953 : *
9954 : * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
9955 : * info.suboffsets = self.view.suboffsets
9956 : * else:
9957 : */
9958 4 : goto __pyx_L8;
9959 : }
9960 :
9961 : /* "View.MemoryView":539
9962 : * info.suboffsets = self.view.suboffsets
9963 : * else:
9964 : * info.suboffsets = NULL # <<<<<<<<<<<<<<
9965 : *
9966 : * if flags & PyBUF_FORMAT:
9967 : */
9968 : /*else*/ {
9969 0 : __pyx_v_info->suboffsets = NULL;
9970 : }
9971 4 : __pyx_L8:;
9972 :
9973 : /* "View.MemoryView":541
9974 : * info.suboffsets = NULL
9975 : *
9976 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9977 : * info.format = self.view.format
9978 : * else:
9979 : */
9980 4 : __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9981 4 : if (__pyx_t_1) {
9982 :
9983 : /* "View.MemoryView":542
9984 : *
9985 : * if flags & PyBUF_FORMAT:
9986 : * info.format = self.view.format # <<<<<<<<<<<<<<
9987 : * else:
9988 : * info.format = NULL
9989 : */
9990 4 : __pyx_t_4 = __pyx_v_self->view.format;
9991 4 : __pyx_v_info->format = __pyx_t_4;
9992 :
9993 : /* "View.MemoryView":541
9994 : * info.suboffsets = NULL
9995 : *
9996 : * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9997 : * info.format = self.view.format
9998 : * else:
9999 : */
10000 4 : goto __pyx_L9;
10001 : }
10002 :
10003 : /* "View.MemoryView":544
10004 : * info.format = self.view.format
10005 : * else:
10006 : * info.format = NULL # <<<<<<<<<<<<<<
10007 : *
10008 : * info.buf = self.view.buf
10009 : */
10010 : /*else*/ {
10011 0 : __pyx_v_info->format = NULL;
10012 : }
10013 4 : __pyx_L9:;
10014 :
10015 : /* "View.MemoryView":546
10016 : * info.format = NULL
10017 : *
10018 : * info.buf = self.view.buf # <<<<<<<<<<<<<<
10019 : * info.ndim = self.view.ndim
10020 : * info.itemsize = self.view.itemsize
10021 : */
10022 4 : __pyx_t_5 = __pyx_v_self->view.buf;
10023 4 : __pyx_v_info->buf = __pyx_t_5;
10024 :
10025 : /* "View.MemoryView":547
10026 : *
10027 : * info.buf = self.view.buf
10028 : * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
10029 : * info.itemsize = self.view.itemsize
10030 : * info.len = self.view.len
10031 : */
10032 4 : __pyx_t_6 = __pyx_v_self->view.ndim;
10033 4 : __pyx_v_info->ndim = __pyx_t_6;
10034 :
10035 : /* "View.MemoryView":548
10036 : * info.buf = self.view.buf
10037 : * info.ndim = self.view.ndim
10038 : * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
10039 : * info.len = self.view.len
10040 : * info.readonly = self.view.readonly
10041 : */
10042 4 : __pyx_t_7 = __pyx_v_self->view.itemsize;
10043 4 : __pyx_v_info->itemsize = __pyx_t_7;
10044 :
10045 : /* "View.MemoryView":549
10046 : * info.ndim = self.view.ndim
10047 : * info.itemsize = self.view.itemsize
10048 : * info.len = self.view.len # <<<<<<<<<<<<<<
10049 : * info.readonly = self.view.readonly
10050 : * info.obj = self
10051 : */
10052 4 : __pyx_t_7 = __pyx_v_self->view.len;
10053 4 : __pyx_v_info->len = __pyx_t_7;
10054 :
10055 : /* "View.MemoryView":550
10056 : * info.itemsize = self.view.itemsize
10057 : * info.len = self.view.len
10058 : * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
10059 : * info.obj = self
10060 : *
10061 : */
10062 4 : __pyx_t_1 = __pyx_v_self->view.readonly;
10063 4 : __pyx_v_info->readonly = __pyx_t_1;
10064 :
10065 : /* "View.MemoryView":551
10066 : * info.len = self.view.len
10067 : * info.readonly = self.view.readonly
10068 : * info.obj = self # <<<<<<<<<<<<<<
10069 : *
10070 : *
10071 : */
10072 4 : __Pyx_INCREF((PyObject *)__pyx_v_self);
10073 4 : __Pyx_GIVEREF((PyObject *)__pyx_v_self);
10074 4 : __Pyx_GOTREF(__pyx_v_info->obj);
10075 4 : __Pyx_DECREF(__pyx_v_info->obj);
10076 4 : __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
10077 :
10078 : /* "View.MemoryView":521
10079 : * itemp[i] = c
10080 : *
10081 : * @cname('getbuffer') # <<<<<<<<<<<<<<
10082 : * def __getbuffer__(self, Py_buffer *info, int flags):
10083 : * if flags & PyBUF_WRITABLE and self.view.readonly:
10084 : */
10085 :
10086 : /* function exit code */
10087 4 : __pyx_r = 0;
10088 4 : goto __pyx_L0;
10089 0 : __pyx_L1_error:;
10090 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10091 0 : __pyx_r = -1;
10092 0 : if (__pyx_v_info->obj != NULL) {
10093 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10094 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10095 : }
10096 0 : goto __pyx_L2;
10097 4 : __pyx_L0:;
10098 4 : if (__pyx_v_info->obj == Py_None) {
10099 0 : __Pyx_GOTREF(__pyx_v_info->obj);
10100 0 : __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
10101 : }
10102 4 : __pyx_L2:;
10103 : __Pyx_RefNannyFinishContext();
10104 : return __pyx_r;
10105 : }
10106 :
10107 : /* "View.MemoryView":554
10108 : *
10109 : *
10110 : * @property # <<<<<<<<<<<<<<
10111 : * def T(self):
10112 : * cdef _memoryviewslice result = memoryview_copy(self)
10113 : */
10114 :
10115 : /* Python wrapper */
10116 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
10117 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
10118 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10119 0 : PyObject *__pyx_r = 0;
10120 : __Pyx_RefNannyDeclarations
10121 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10122 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10123 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10124 :
10125 : /* function exit code */
10126 0 : __Pyx_RefNannyFinishContext();
10127 0 : return __pyx_r;
10128 : }
10129 :
10130 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10131 0 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
10132 0 : PyObject *__pyx_r = NULL;
10133 : __Pyx_RefNannyDeclarations
10134 0 : PyObject *__pyx_t_1 = NULL;
10135 0 : int __pyx_t_2;
10136 0 : int __pyx_lineno = 0;
10137 0 : const char *__pyx_filename = NULL;
10138 0 : int __pyx_clineno = 0;
10139 0 : __Pyx_RefNannySetupContext("__get__", 1);
10140 :
10141 : /* "View.MemoryView":556
10142 : * @property
10143 : * def T(self):
10144 : * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
10145 : * transpose_memslice(&result.from_slice)
10146 : * return result
10147 : */
10148 0 : __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
10149 0 : __Pyx_GOTREF(__pyx_t_1);
10150 0 : if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 556, __pyx_L1_error)
10151 0 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
10152 0 : __pyx_t_1 = 0;
10153 :
10154 : /* "View.MemoryView":557
10155 : * def T(self):
10156 : * cdef _memoryviewslice result = memoryview_copy(self)
10157 : * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
10158 : * return result
10159 : *
10160 : */
10161 0 : __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(1, 557, __pyx_L1_error)
10162 :
10163 : /* "View.MemoryView":558
10164 : * cdef _memoryviewslice result = memoryview_copy(self)
10165 : * transpose_memslice(&result.from_slice)
10166 : * return result # <<<<<<<<<<<<<<
10167 : *
10168 : * @property
10169 : */
10170 0 : __Pyx_XDECREF(__pyx_r);
10171 0 : __Pyx_INCREF((PyObject *)__pyx_v_result);
10172 0 : __pyx_r = ((PyObject *)__pyx_v_result);
10173 0 : goto __pyx_L0;
10174 :
10175 : /* "View.MemoryView":554
10176 : *
10177 : *
10178 : * @property # <<<<<<<<<<<<<<
10179 : * def T(self):
10180 : * cdef _memoryviewslice result = memoryview_copy(self)
10181 : */
10182 :
10183 : /* function exit code */
10184 0 : __pyx_L1_error:;
10185 0 : __Pyx_XDECREF(__pyx_t_1);
10186 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10187 0 : __pyx_r = NULL;
10188 0 : __pyx_L0:;
10189 0 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
10190 0 : __Pyx_XGIVEREF(__pyx_r);
10191 0 : __Pyx_RefNannyFinishContext();
10192 0 : return __pyx_r;
10193 : }
10194 :
10195 : /* "View.MemoryView":560
10196 : * return result
10197 : *
10198 : * @property # <<<<<<<<<<<<<<
10199 : * def base(self):
10200 : * return self._get_base()
10201 : */
10202 :
10203 : /* Python wrapper */
10204 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
10205 426 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
10206 426 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10207 426 : PyObject *__pyx_r = 0;
10208 : __Pyx_RefNannyDeclarations
10209 426 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10210 426 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10211 852 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10212 :
10213 : /* function exit code */
10214 426 : __Pyx_RefNannyFinishContext();
10215 426 : return __pyx_r;
10216 : }
10217 :
10218 426 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10219 426 : PyObject *__pyx_r = NULL;
10220 : __Pyx_RefNannyDeclarations
10221 426 : PyObject *__pyx_t_1 = NULL;
10222 426 : int __pyx_lineno = 0;
10223 426 : const char *__pyx_filename = NULL;
10224 426 : int __pyx_clineno = 0;
10225 426 : __Pyx_RefNannySetupContext("__get__", 1);
10226 :
10227 : /* "View.MemoryView":562
10228 : * @property
10229 : * def base(self):
10230 : * return self._get_base() # <<<<<<<<<<<<<<
10231 : *
10232 : * cdef _get_base(self):
10233 : */
10234 426 : __Pyx_XDECREF(__pyx_r);
10235 426 : __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->_get_base(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 562, __pyx_L1_error)
10236 426 : __Pyx_GOTREF(__pyx_t_1);
10237 426 : __pyx_r = __pyx_t_1;
10238 426 : __pyx_t_1 = 0;
10239 426 : goto __pyx_L0;
10240 :
10241 : /* "View.MemoryView":560
10242 : * return result
10243 : *
10244 : * @property # <<<<<<<<<<<<<<
10245 : * def base(self):
10246 : * return self._get_base()
10247 : */
10248 :
10249 : /* function exit code */
10250 0 : __pyx_L1_error:;
10251 0 : __Pyx_XDECREF(__pyx_t_1);
10252 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10253 0 : __pyx_r = NULL;
10254 426 : __pyx_L0:;
10255 426 : __Pyx_XGIVEREF(__pyx_r);
10256 426 : __Pyx_RefNannyFinishContext();
10257 426 : return __pyx_r;
10258 : }
10259 :
10260 : /* "View.MemoryView":564
10261 : * return self._get_base()
10262 : *
10263 : * cdef _get_base(self): # <<<<<<<<<<<<<<
10264 : * return self.obj
10265 : *
10266 : */
10267 :
10268 430 : static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v_self) {
10269 430 : PyObject *__pyx_r = NULL;
10270 : __Pyx_RefNannyDeclarations
10271 430 : __Pyx_RefNannySetupContext("_get_base", 1);
10272 :
10273 : /* "View.MemoryView":565
10274 : *
10275 : * cdef _get_base(self):
10276 : * return self.obj # <<<<<<<<<<<<<<
10277 : *
10278 : * @property
10279 : */
10280 430 : __Pyx_XDECREF(__pyx_r);
10281 430 : __Pyx_INCREF(__pyx_v_self->obj);
10282 430 : __pyx_r = __pyx_v_self->obj;
10283 430 : goto __pyx_L0;
10284 :
10285 : /* "View.MemoryView":564
10286 : * return self._get_base()
10287 : *
10288 : * cdef _get_base(self): # <<<<<<<<<<<<<<
10289 : * return self.obj
10290 : *
10291 : */
10292 :
10293 : /* function exit code */
10294 430 : __pyx_L0:;
10295 430 : __Pyx_XGIVEREF(__pyx_r);
10296 430 : __Pyx_RefNannyFinishContext();
10297 430 : return __pyx_r;
10298 : }
10299 :
10300 : /* "View.MemoryView":567
10301 : * return self.obj
10302 : *
10303 : * @property # <<<<<<<<<<<<<<
10304 : * def shape(self):
10305 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10306 : */
10307 :
10308 : /* Python wrapper */
10309 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
10310 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
10311 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10312 0 : PyObject *__pyx_r = 0;
10313 : __Pyx_RefNannyDeclarations
10314 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10315 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10316 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10317 :
10318 : /* function exit code */
10319 0 : __Pyx_RefNannyFinishContext();
10320 0 : return __pyx_r;
10321 : }
10322 :
10323 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10324 0 : Py_ssize_t __pyx_7genexpr__pyx_v_length;
10325 0 : PyObject *__pyx_r = NULL;
10326 : __Pyx_RefNannyDeclarations
10327 0 : PyObject *__pyx_t_1 = NULL;
10328 0 : Py_ssize_t *__pyx_t_2;
10329 0 : Py_ssize_t *__pyx_t_3;
10330 0 : Py_ssize_t *__pyx_t_4;
10331 0 : PyObject *__pyx_t_5 = NULL;
10332 0 : int __pyx_lineno = 0;
10333 0 : const char *__pyx_filename = NULL;
10334 0 : int __pyx_clineno = 0;
10335 0 : __Pyx_RefNannySetupContext("__get__", 1);
10336 :
10337 : /* "View.MemoryView":569
10338 : * @property
10339 : * def shape(self):
10340 : * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
10341 : *
10342 : * @property
10343 : */
10344 0 : __Pyx_XDECREF(__pyx_r);
10345 : { /* enter inner scope */
10346 0 : __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __pyx_L1_error)
10347 0 : __Pyx_GOTREF(__pyx_t_1);
10348 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10349 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10350 0 : __pyx_t_2 = __pyx_t_4;
10351 0 : __pyx_7genexpr__pyx_v_length = (__pyx_t_2[0]);
10352 0 : __pyx_t_5 = PyInt_FromSsize_t(__pyx_7genexpr__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
10353 0 : __Pyx_GOTREF(__pyx_t_5);
10354 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 569, __pyx_L1_error)
10355 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10356 : }
10357 : } /* exit inner scope */
10358 0 : __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 569, __pyx_L1_error)
10359 0 : __Pyx_GOTREF(__pyx_t_5);
10360 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10361 0 : __pyx_r = __pyx_t_5;
10362 0 : __pyx_t_5 = 0;
10363 0 : goto __pyx_L0;
10364 :
10365 : /* "View.MemoryView":567
10366 : * return self.obj
10367 : *
10368 : * @property # <<<<<<<<<<<<<<
10369 : * def shape(self):
10370 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10371 : */
10372 :
10373 : /* function exit code */
10374 0 : __pyx_L1_error:;
10375 0 : __Pyx_XDECREF(__pyx_t_1);
10376 0 : __Pyx_XDECREF(__pyx_t_5);
10377 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10378 0 : __pyx_r = NULL;
10379 0 : __pyx_L0:;
10380 0 : __Pyx_XGIVEREF(__pyx_r);
10381 0 : __Pyx_RefNannyFinishContext();
10382 0 : return __pyx_r;
10383 : }
10384 :
10385 : /* "View.MemoryView":571
10386 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10387 : *
10388 : * @property # <<<<<<<<<<<<<<
10389 : * def strides(self):
10390 : * if self.view.strides == NULL:
10391 : */
10392 :
10393 : /* Python wrapper */
10394 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
10395 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
10396 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10397 0 : PyObject *__pyx_r = 0;
10398 : __Pyx_RefNannyDeclarations
10399 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10400 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10401 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10402 :
10403 : /* function exit code */
10404 0 : __Pyx_RefNannyFinishContext();
10405 0 : return __pyx_r;
10406 : }
10407 :
10408 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10409 0 : Py_ssize_t __pyx_8genexpr1__pyx_v_stride;
10410 0 : PyObject *__pyx_r = NULL;
10411 : __Pyx_RefNannyDeclarations
10412 0 : int __pyx_t_1;
10413 0 : PyObject *__pyx_t_2 = NULL;
10414 0 : Py_ssize_t *__pyx_t_3;
10415 0 : Py_ssize_t *__pyx_t_4;
10416 0 : Py_ssize_t *__pyx_t_5;
10417 0 : PyObject *__pyx_t_6 = NULL;
10418 0 : int __pyx_lineno = 0;
10419 0 : const char *__pyx_filename = NULL;
10420 0 : int __pyx_clineno = 0;
10421 0 : __Pyx_RefNannySetupContext("__get__", 1);
10422 :
10423 : /* "View.MemoryView":573
10424 : * @property
10425 : * def strides(self):
10426 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10427 : *
10428 : * raise ValueError, "Buffer view does not expose strides"
10429 : */
10430 0 : __pyx_t_1 = (__pyx_v_self->view.strides == NULL);
10431 0 : if (unlikely(__pyx_t_1)) {
10432 :
10433 : /* "View.MemoryView":575
10434 : * if self.view.strides == NULL:
10435 : *
10436 : * raise ValueError, "Buffer view does not expose strides" # <<<<<<<<<<<<<<
10437 : *
10438 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10439 : */
10440 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Buffer_view_does_not_expose_stri, 0, 0);
10441 0 : __PYX_ERR(1, 575, __pyx_L1_error)
10442 :
10443 : /* "View.MemoryView":573
10444 : * @property
10445 : * def strides(self):
10446 : * if self.view.strides == NULL: # <<<<<<<<<<<<<<
10447 : *
10448 : * raise ValueError, "Buffer view does not expose strides"
10449 : */
10450 : }
10451 :
10452 : /* "View.MemoryView":577
10453 : * raise ValueError, "Buffer view does not expose strides"
10454 : *
10455 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
10456 : *
10457 : * @property
10458 : */
10459 0 : __Pyx_XDECREF(__pyx_r);
10460 : { /* enter inner scope */
10461 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
10462 0 : __Pyx_GOTREF(__pyx_t_2);
10463 0 : __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
10464 0 : for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10465 0 : __pyx_t_3 = __pyx_t_5;
10466 0 : __pyx_8genexpr1__pyx_v_stride = (__pyx_t_3[0]);
10467 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr1__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
10468 0 : __Pyx_GOTREF(__pyx_t_6);
10469 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 577, __pyx_L1_error)
10470 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10471 : }
10472 : } /* exit inner scope */
10473 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 577, __pyx_L1_error)
10474 0 : __Pyx_GOTREF(__pyx_t_6);
10475 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10476 0 : __pyx_r = __pyx_t_6;
10477 0 : __pyx_t_6 = 0;
10478 0 : goto __pyx_L0;
10479 :
10480 : /* "View.MemoryView":571
10481 : * return tuple([length for length in self.view.shape[:self.view.ndim]])
10482 : *
10483 : * @property # <<<<<<<<<<<<<<
10484 : * def strides(self):
10485 : * if self.view.strides == NULL:
10486 : */
10487 :
10488 : /* function exit code */
10489 0 : __pyx_L1_error:;
10490 0 : __Pyx_XDECREF(__pyx_t_2);
10491 0 : __Pyx_XDECREF(__pyx_t_6);
10492 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10493 0 : __pyx_r = NULL;
10494 0 : __pyx_L0:;
10495 0 : __Pyx_XGIVEREF(__pyx_r);
10496 0 : __Pyx_RefNannyFinishContext();
10497 0 : return __pyx_r;
10498 : }
10499 :
10500 : /* "View.MemoryView":579
10501 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10502 : *
10503 : * @property # <<<<<<<<<<<<<<
10504 : * def suboffsets(self):
10505 : * if self.view.suboffsets == NULL:
10506 : */
10507 :
10508 : /* Python wrapper */
10509 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
10510 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
10511 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10512 0 : PyObject *__pyx_r = 0;
10513 : __Pyx_RefNannyDeclarations
10514 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10515 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10516 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10517 :
10518 : /* function exit code */
10519 0 : __Pyx_RefNannyFinishContext();
10520 0 : return __pyx_r;
10521 : }
10522 :
10523 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10524 0 : Py_ssize_t __pyx_8genexpr2__pyx_v_suboffset;
10525 0 : PyObject *__pyx_r = NULL;
10526 : __Pyx_RefNannyDeclarations
10527 0 : int __pyx_t_1;
10528 0 : PyObject *__pyx_t_2 = NULL;
10529 0 : Py_ssize_t *__pyx_t_3;
10530 0 : Py_ssize_t *__pyx_t_4;
10531 0 : Py_ssize_t *__pyx_t_5;
10532 0 : PyObject *__pyx_t_6 = NULL;
10533 0 : int __pyx_lineno = 0;
10534 0 : const char *__pyx_filename = NULL;
10535 0 : int __pyx_clineno = 0;
10536 0 : __Pyx_RefNannySetupContext("__get__", 1);
10537 :
10538 : /* "View.MemoryView":581
10539 : * @property
10540 : * def suboffsets(self):
10541 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10542 : * return (-1,) * self.view.ndim
10543 : *
10544 : */
10545 0 : __pyx_t_1 = (__pyx_v_self->view.suboffsets == NULL);
10546 0 : if (__pyx_t_1) {
10547 :
10548 : /* "View.MemoryView":582
10549 : * def suboffsets(self):
10550 : * if self.view.suboffsets == NULL:
10551 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
10552 : *
10553 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10554 : */
10555 0 : __Pyx_XDECREF(__pyx_r);
10556 0 : __pyx_t_2 = __Pyx_PySequence_Multiply(__pyx_tuple__4, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 582, __pyx_L1_error)
10557 0 : __Pyx_GOTREF(__pyx_t_2);
10558 0 : __pyx_r = __pyx_t_2;
10559 0 : __pyx_t_2 = 0;
10560 0 : goto __pyx_L0;
10561 :
10562 : /* "View.MemoryView":581
10563 : * @property
10564 : * def suboffsets(self):
10565 : * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
10566 : * return (-1,) * self.view.ndim
10567 : *
10568 : */
10569 : }
10570 :
10571 : /* "View.MemoryView":584
10572 : * return (-1,) * self.view.ndim
10573 : *
10574 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
10575 : *
10576 : * @property
10577 : */
10578 0 : __Pyx_XDECREF(__pyx_r);
10579 : { /* enter inner scope */
10580 0 : __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 584, __pyx_L1_error)
10581 0 : __Pyx_GOTREF(__pyx_t_2);
10582 0 : __pyx_t_4 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
10583 0 : for (__pyx_t_5 = __pyx_v_self->view.suboffsets; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
10584 0 : __pyx_t_3 = __pyx_t_5;
10585 0 : __pyx_8genexpr2__pyx_v_suboffset = (__pyx_t_3[0]);
10586 0 : __pyx_t_6 = PyInt_FromSsize_t(__pyx_8genexpr2__pyx_v_suboffset); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
10587 0 : __Pyx_GOTREF(__pyx_t_6);
10588 0 : if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 584, __pyx_L1_error)
10589 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10590 : }
10591 : } /* exit inner scope */
10592 0 : __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
10593 0 : __Pyx_GOTREF(__pyx_t_6);
10594 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10595 0 : __pyx_r = __pyx_t_6;
10596 0 : __pyx_t_6 = 0;
10597 0 : goto __pyx_L0;
10598 :
10599 : /* "View.MemoryView":579
10600 : * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
10601 : *
10602 : * @property # <<<<<<<<<<<<<<
10603 : * def suboffsets(self):
10604 : * if self.view.suboffsets == NULL:
10605 : */
10606 :
10607 : /* function exit code */
10608 0 : __pyx_L1_error:;
10609 0 : __Pyx_XDECREF(__pyx_t_2);
10610 0 : __Pyx_XDECREF(__pyx_t_6);
10611 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10612 0 : __pyx_r = NULL;
10613 0 : __pyx_L0:;
10614 0 : __Pyx_XGIVEREF(__pyx_r);
10615 0 : __Pyx_RefNannyFinishContext();
10616 0 : return __pyx_r;
10617 : }
10618 :
10619 : /* "View.MemoryView":586
10620 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10621 : *
10622 : * @property # <<<<<<<<<<<<<<
10623 : * def ndim(self):
10624 : * return self.view.ndim
10625 : */
10626 :
10627 : /* Python wrapper */
10628 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
10629 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
10630 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10631 0 : PyObject *__pyx_r = 0;
10632 : __Pyx_RefNannyDeclarations
10633 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10634 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10635 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10636 :
10637 : /* function exit code */
10638 0 : __Pyx_RefNannyFinishContext();
10639 0 : return __pyx_r;
10640 : }
10641 :
10642 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10643 0 : PyObject *__pyx_r = NULL;
10644 : __Pyx_RefNannyDeclarations
10645 0 : PyObject *__pyx_t_1 = NULL;
10646 0 : int __pyx_lineno = 0;
10647 0 : const char *__pyx_filename = NULL;
10648 0 : int __pyx_clineno = 0;
10649 0 : __Pyx_RefNannySetupContext("__get__", 1);
10650 :
10651 : /* "View.MemoryView":588
10652 : * @property
10653 : * def ndim(self):
10654 : * return self.view.ndim # <<<<<<<<<<<<<<
10655 : *
10656 : * @property
10657 : */
10658 0 : __Pyx_XDECREF(__pyx_r);
10659 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 588, __pyx_L1_error)
10660 0 : __Pyx_GOTREF(__pyx_t_1);
10661 0 : __pyx_r = __pyx_t_1;
10662 0 : __pyx_t_1 = 0;
10663 0 : goto __pyx_L0;
10664 :
10665 : /* "View.MemoryView":586
10666 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
10667 : *
10668 : * @property # <<<<<<<<<<<<<<
10669 : * def ndim(self):
10670 : * return self.view.ndim
10671 : */
10672 :
10673 : /* function exit code */
10674 0 : __pyx_L1_error:;
10675 0 : __Pyx_XDECREF(__pyx_t_1);
10676 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10677 0 : __pyx_r = NULL;
10678 0 : __pyx_L0:;
10679 0 : __Pyx_XGIVEREF(__pyx_r);
10680 0 : __Pyx_RefNannyFinishContext();
10681 0 : return __pyx_r;
10682 : }
10683 :
10684 : /* "View.MemoryView":590
10685 : * return self.view.ndim
10686 : *
10687 : * @property # <<<<<<<<<<<<<<
10688 : * def itemsize(self):
10689 : * return self.view.itemsize
10690 : */
10691 :
10692 : /* Python wrapper */
10693 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
10694 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
10695 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10696 0 : PyObject *__pyx_r = 0;
10697 : __Pyx_RefNannyDeclarations
10698 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10699 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10700 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10701 :
10702 : /* function exit code */
10703 0 : __Pyx_RefNannyFinishContext();
10704 0 : return __pyx_r;
10705 : }
10706 :
10707 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10708 0 : PyObject *__pyx_r = NULL;
10709 : __Pyx_RefNannyDeclarations
10710 0 : PyObject *__pyx_t_1 = NULL;
10711 0 : int __pyx_lineno = 0;
10712 0 : const char *__pyx_filename = NULL;
10713 0 : int __pyx_clineno = 0;
10714 0 : __Pyx_RefNannySetupContext("__get__", 1);
10715 :
10716 : /* "View.MemoryView":592
10717 : * @property
10718 : * def itemsize(self):
10719 : * return self.view.itemsize # <<<<<<<<<<<<<<
10720 : *
10721 : * @property
10722 : */
10723 0 : __Pyx_XDECREF(__pyx_r);
10724 0 : __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 592, __pyx_L1_error)
10725 0 : __Pyx_GOTREF(__pyx_t_1);
10726 0 : __pyx_r = __pyx_t_1;
10727 0 : __pyx_t_1 = 0;
10728 0 : goto __pyx_L0;
10729 :
10730 : /* "View.MemoryView":590
10731 : * return self.view.ndim
10732 : *
10733 : * @property # <<<<<<<<<<<<<<
10734 : * def itemsize(self):
10735 : * return self.view.itemsize
10736 : */
10737 :
10738 : /* function exit code */
10739 0 : __pyx_L1_error:;
10740 0 : __Pyx_XDECREF(__pyx_t_1);
10741 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10742 0 : __pyx_r = NULL;
10743 0 : __pyx_L0:;
10744 0 : __Pyx_XGIVEREF(__pyx_r);
10745 0 : __Pyx_RefNannyFinishContext();
10746 0 : return __pyx_r;
10747 : }
10748 :
10749 : /* "View.MemoryView":594
10750 : * return self.view.itemsize
10751 : *
10752 : * @property # <<<<<<<<<<<<<<
10753 : * def nbytes(self):
10754 : * return self.size * self.view.itemsize
10755 : */
10756 :
10757 : /* Python wrapper */
10758 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
10759 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
10760 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10761 0 : PyObject *__pyx_r = 0;
10762 : __Pyx_RefNannyDeclarations
10763 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10764 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10765 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10766 :
10767 : /* function exit code */
10768 0 : __Pyx_RefNannyFinishContext();
10769 0 : return __pyx_r;
10770 : }
10771 :
10772 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10773 0 : PyObject *__pyx_r = NULL;
10774 : __Pyx_RefNannyDeclarations
10775 0 : PyObject *__pyx_t_1 = NULL;
10776 0 : PyObject *__pyx_t_2 = NULL;
10777 0 : PyObject *__pyx_t_3 = NULL;
10778 0 : int __pyx_lineno = 0;
10779 0 : const char *__pyx_filename = NULL;
10780 0 : int __pyx_clineno = 0;
10781 0 : __Pyx_RefNannySetupContext("__get__", 1);
10782 :
10783 : /* "View.MemoryView":596
10784 : * @property
10785 : * def nbytes(self):
10786 : * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
10787 : *
10788 : * @property
10789 : */
10790 0 : __Pyx_XDECREF(__pyx_r);
10791 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 596, __pyx_L1_error)
10792 0 : __Pyx_GOTREF(__pyx_t_1);
10793 0 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
10794 0 : __Pyx_GOTREF(__pyx_t_2);
10795 0 : __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
10796 0 : __Pyx_GOTREF(__pyx_t_3);
10797 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10798 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10799 0 : __pyx_r = __pyx_t_3;
10800 0 : __pyx_t_3 = 0;
10801 0 : goto __pyx_L0;
10802 :
10803 : /* "View.MemoryView":594
10804 : * return self.view.itemsize
10805 : *
10806 : * @property # <<<<<<<<<<<<<<
10807 : * def nbytes(self):
10808 : * return self.size * self.view.itemsize
10809 : */
10810 :
10811 : /* function exit code */
10812 0 : __pyx_L1_error:;
10813 0 : __Pyx_XDECREF(__pyx_t_1);
10814 0 : __Pyx_XDECREF(__pyx_t_2);
10815 0 : __Pyx_XDECREF(__pyx_t_3);
10816 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10817 0 : __pyx_r = NULL;
10818 0 : __pyx_L0:;
10819 0 : __Pyx_XGIVEREF(__pyx_r);
10820 0 : __Pyx_RefNannyFinishContext();
10821 0 : return __pyx_r;
10822 : }
10823 :
10824 : /* "View.MemoryView":598
10825 : * return self.size * self.view.itemsize
10826 : *
10827 : * @property # <<<<<<<<<<<<<<
10828 : * def size(self):
10829 : * if self._size is None:
10830 : */
10831 :
10832 : /* Python wrapper */
10833 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
10834 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
10835 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10836 0 : PyObject *__pyx_r = 0;
10837 : __Pyx_RefNannyDeclarations
10838 0 : __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10839 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10840 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10841 :
10842 : /* function exit code */
10843 0 : __Pyx_RefNannyFinishContext();
10844 0 : return __pyx_r;
10845 : }
10846 :
10847 0 : static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
10848 0 : PyObject *__pyx_v_result = NULL;
10849 0 : PyObject *__pyx_v_length = NULL;
10850 0 : PyObject *__pyx_r = NULL;
10851 : __Pyx_RefNannyDeclarations
10852 0 : int __pyx_t_1;
10853 0 : Py_ssize_t *__pyx_t_2;
10854 0 : Py_ssize_t *__pyx_t_3;
10855 0 : Py_ssize_t *__pyx_t_4;
10856 0 : PyObject *__pyx_t_5 = NULL;
10857 0 : int __pyx_lineno = 0;
10858 0 : const char *__pyx_filename = NULL;
10859 0 : int __pyx_clineno = 0;
10860 0 : __Pyx_RefNannySetupContext("__get__", 1);
10861 :
10862 : /* "View.MemoryView":600
10863 : * @property
10864 : * def size(self):
10865 : * if self._size is None: # <<<<<<<<<<<<<<
10866 : * result = 1
10867 : *
10868 : */
10869 0 : __pyx_t_1 = (__pyx_v_self->_size == Py_None);
10870 0 : if (__pyx_t_1) {
10871 :
10872 : /* "View.MemoryView":601
10873 : * def size(self):
10874 : * if self._size is None:
10875 : * result = 1 # <<<<<<<<<<<<<<
10876 : *
10877 : * for length in self.view.shape[:self.view.ndim]:
10878 : */
10879 0 : __Pyx_INCREF(__pyx_int_1);
10880 0 : __pyx_v_result = __pyx_int_1;
10881 :
10882 : /* "View.MemoryView":603
10883 : * result = 1
10884 : *
10885 : * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
10886 : * result *= length
10887 : *
10888 : */
10889 0 : __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
10890 0 : for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
10891 0 : __pyx_t_2 = __pyx_t_4;
10892 0 : __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_2[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 603, __pyx_L1_error)
10893 0 : __Pyx_GOTREF(__pyx_t_5);
10894 0 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_5);
10895 0 : __pyx_t_5 = 0;
10896 :
10897 : /* "View.MemoryView":604
10898 : *
10899 : * for length in self.view.shape[:self.view.ndim]:
10900 : * result *= length # <<<<<<<<<<<<<<
10901 : *
10902 : * self._size = result
10903 : */
10904 0 : __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
10905 0 : __Pyx_GOTREF(__pyx_t_5);
10906 0 : __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_5);
10907 0 : __pyx_t_5 = 0;
10908 : }
10909 :
10910 : /* "View.MemoryView":606
10911 : * result *= length
10912 : *
10913 : * self._size = result # <<<<<<<<<<<<<<
10914 : *
10915 : * return self._size
10916 : */
10917 0 : __Pyx_INCREF(__pyx_v_result);
10918 0 : __Pyx_GIVEREF(__pyx_v_result);
10919 0 : __Pyx_GOTREF(__pyx_v_self->_size);
10920 0 : __Pyx_DECREF(__pyx_v_self->_size);
10921 0 : __pyx_v_self->_size = __pyx_v_result;
10922 :
10923 : /* "View.MemoryView":600
10924 : * @property
10925 : * def size(self):
10926 : * if self._size is None: # <<<<<<<<<<<<<<
10927 : * result = 1
10928 : *
10929 : */
10930 : }
10931 :
10932 : /* "View.MemoryView":608
10933 : * self._size = result
10934 : *
10935 : * return self._size # <<<<<<<<<<<<<<
10936 : *
10937 : * def __len__(self):
10938 : */
10939 0 : __Pyx_XDECREF(__pyx_r);
10940 0 : __Pyx_INCREF(__pyx_v_self->_size);
10941 0 : __pyx_r = __pyx_v_self->_size;
10942 0 : goto __pyx_L0;
10943 :
10944 : /* "View.MemoryView":598
10945 : * return self.size * self.view.itemsize
10946 : *
10947 : * @property # <<<<<<<<<<<<<<
10948 : * def size(self):
10949 : * if self._size is None:
10950 : */
10951 :
10952 : /* function exit code */
10953 0 : __pyx_L1_error:;
10954 0 : __Pyx_XDECREF(__pyx_t_5);
10955 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10956 0 : __pyx_r = NULL;
10957 0 : __pyx_L0:;
10958 0 : __Pyx_XDECREF(__pyx_v_result);
10959 0 : __Pyx_XDECREF(__pyx_v_length);
10960 0 : __Pyx_XGIVEREF(__pyx_r);
10961 0 : __Pyx_RefNannyFinishContext();
10962 0 : return __pyx_r;
10963 : }
10964 :
10965 : /* "View.MemoryView":610
10966 : * return self._size
10967 : *
10968 : * def __len__(self): # <<<<<<<<<<<<<<
10969 : * if self.view.ndim >= 1:
10970 : * return self.view.shape[0]
10971 : */
10972 :
10973 : /* Python wrapper */
10974 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
10975 0 : static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
10976 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
10977 0 : Py_ssize_t __pyx_r;
10978 : __Pyx_RefNannyDeclarations
10979 0 : __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
10980 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
10981 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10982 :
10983 : /* function exit code */
10984 0 : __Pyx_RefNannyFinishContext();
10985 0 : return __pyx_r;
10986 : }
10987 :
10988 0 : static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
10989 0 : Py_ssize_t __pyx_r;
10990 0 : int __pyx_t_1;
10991 :
10992 : /* "View.MemoryView":611
10993 : *
10994 : * def __len__(self):
10995 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
10996 : * return self.view.shape[0]
10997 : *
10998 : */
10999 0 : __pyx_t_1 = (__pyx_v_self->view.ndim >= 1);
11000 0 : if (__pyx_t_1) {
11001 :
11002 : /* "View.MemoryView":612
11003 : * def __len__(self):
11004 : * if self.view.ndim >= 1:
11005 : * return self.view.shape[0] # <<<<<<<<<<<<<<
11006 : *
11007 : * return 0
11008 : */
11009 0 : __pyx_r = (__pyx_v_self->view.shape[0]);
11010 0 : goto __pyx_L0;
11011 :
11012 : /* "View.MemoryView":611
11013 : *
11014 : * def __len__(self):
11015 : * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
11016 : * return self.view.shape[0]
11017 : *
11018 : */
11019 : }
11020 :
11021 : /* "View.MemoryView":614
11022 : * return self.view.shape[0]
11023 : *
11024 : * return 0 # <<<<<<<<<<<<<<
11025 : *
11026 : * def __repr__(self):
11027 : */
11028 0 : __pyx_r = 0;
11029 0 : goto __pyx_L0;
11030 :
11031 : /* "View.MemoryView":610
11032 : * return self._size
11033 : *
11034 : * def __len__(self): # <<<<<<<<<<<<<<
11035 : * if self.view.ndim >= 1:
11036 : * return self.view.shape[0]
11037 : */
11038 :
11039 : /* function exit code */
11040 0 : __pyx_L0:;
11041 0 : return __pyx_r;
11042 : }
11043 :
11044 : /* "View.MemoryView":616
11045 : * return 0
11046 : *
11047 : * def __repr__(self): # <<<<<<<<<<<<<<
11048 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11049 : * id(self))
11050 : */
11051 :
11052 : /* Python wrapper */
11053 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
11054 0 : static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
11055 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11056 0 : PyObject *__pyx_r = 0;
11057 : __Pyx_RefNannyDeclarations
11058 0 : __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
11059 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11060 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11061 :
11062 : /* function exit code */
11063 0 : __Pyx_RefNannyFinishContext();
11064 0 : return __pyx_r;
11065 : }
11066 :
11067 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
11068 0 : PyObject *__pyx_r = NULL;
11069 : __Pyx_RefNannyDeclarations
11070 0 : PyObject *__pyx_t_1 = NULL;
11071 0 : PyObject *__pyx_t_2 = NULL;
11072 0 : PyObject *__pyx_t_3 = NULL;
11073 0 : int __pyx_lineno = 0;
11074 0 : const char *__pyx_filename = NULL;
11075 0 : int __pyx_clineno = 0;
11076 0 : __Pyx_RefNannySetupContext("__repr__", 1);
11077 :
11078 : /* "View.MemoryView":617
11079 : *
11080 : * def __repr__(self):
11081 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11082 : * id(self))
11083 : *
11084 : */
11085 0 : __Pyx_XDECREF(__pyx_r);
11086 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11087 0 : __Pyx_GOTREF(__pyx_t_1);
11088 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11089 0 : __Pyx_GOTREF(__pyx_t_2);
11090 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11091 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error)
11092 0 : __Pyx_GOTREF(__pyx_t_1);
11093 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11094 :
11095 : /* "View.MemoryView":618
11096 : * def __repr__(self):
11097 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11098 : * id(self)) # <<<<<<<<<<<<<<
11099 : *
11100 : * def __str__(self):
11101 : */
11102 0 : __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 618, __pyx_L1_error)
11103 0 : __Pyx_GOTREF(__pyx_t_2);
11104 :
11105 : /* "View.MemoryView":617
11106 : *
11107 : * def __repr__(self):
11108 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
11109 : * id(self))
11110 : *
11111 : */
11112 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 617, __pyx_L1_error)
11113 0 : __Pyx_GOTREF(__pyx_t_3);
11114 0 : __Pyx_GIVEREF(__pyx_t_1);
11115 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 617, __pyx_L1_error);
11116 0 : __Pyx_GIVEREF(__pyx_t_2);
11117 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error);
11118 0 : __pyx_t_1 = 0;
11119 0 : __pyx_t_2 = 0;
11120 0 : __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 617, __pyx_L1_error)
11121 0 : __Pyx_GOTREF(__pyx_t_2);
11122 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11123 0 : __pyx_r = __pyx_t_2;
11124 0 : __pyx_t_2 = 0;
11125 0 : goto __pyx_L0;
11126 :
11127 : /* "View.MemoryView":616
11128 : * return 0
11129 : *
11130 : * def __repr__(self): # <<<<<<<<<<<<<<
11131 : * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
11132 : * id(self))
11133 : */
11134 :
11135 : /* function exit code */
11136 0 : __pyx_L1_error:;
11137 0 : __Pyx_XDECREF(__pyx_t_1);
11138 0 : __Pyx_XDECREF(__pyx_t_2);
11139 0 : __Pyx_XDECREF(__pyx_t_3);
11140 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11141 0 : __pyx_r = NULL;
11142 0 : __pyx_L0:;
11143 0 : __Pyx_XGIVEREF(__pyx_r);
11144 0 : __Pyx_RefNannyFinishContext();
11145 0 : return __pyx_r;
11146 : }
11147 :
11148 : /* "View.MemoryView":620
11149 : * id(self))
11150 : *
11151 : * def __str__(self): # <<<<<<<<<<<<<<
11152 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11153 : *
11154 : */
11155 :
11156 : /* Python wrapper */
11157 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
11158 0 : static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
11159 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11160 0 : PyObject *__pyx_r = 0;
11161 : __Pyx_RefNannyDeclarations
11162 0 : __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
11163 0 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
11164 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11165 :
11166 : /* function exit code */
11167 0 : __Pyx_RefNannyFinishContext();
11168 0 : return __pyx_r;
11169 : }
11170 :
11171 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
11172 0 : PyObject *__pyx_r = NULL;
11173 : __Pyx_RefNannyDeclarations
11174 0 : PyObject *__pyx_t_1 = NULL;
11175 0 : PyObject *__pyx_t_2 = NULL;
11176 0 : int __pyx_lineno = 0;
11177 0 : const char *__pyx_filename = NULL;
11178 0 : int __pyx_clineno = 0;
11179 0 : __Pyx_RefNannySetupContext("__str__", 1);
11180 :
11181 : /* "View.MemoryView":621
11182 : *
11183 : * def __str__(self):
11184 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
11185 : *
11186 : *
11187 : */
11188 0 : __Pyx_XDECREF(__pyx_r);
11189 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11190 0 : __Pyx_GOTREF(__pyx_t_1);
11191 0 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11192 0 : __Pyx_GOTREF(__pyx_t_2);
11193 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11194 0 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11195 0 : __Pyx_GOTREF(__pyx_t_1);
11196 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11197 0 : __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 621, __pyx_L1_error)
11198 0 : __Pyx_GOTREF(__pyx_t_2);
11199 0 : __Pyx_GIVEREF(__pyx_t_1);
11200 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error);
11201 0 : __pyx_t_1 = 0;
11202 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 621, __pyx_L1_error)
11203 0 : __Pyx_GOTREF(__pyx_t_1);
11204 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11205 0 : __pyx_r = __pyx_t_1;
11206 0 : __pyx_t_1 = 0;
11207 0 : goto __pyx_L0;
11208 :
11209 : /* "View.MemoryView":620
11210 : * id(self))
11211 : *
11212 : * def __str__(self): # <<<<<<<<<<<<<<
11213 : * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
11214 : *
11215 : */
11216 :
11217 : /* function exit code */
11218 0 : __pyx_L1_error:;
11219 0 : __Pyx_XDECREF(__pyx_t_1);
11220 0 : __Pyx_XDECREF(__pyx_t_2);
11221 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11222 0 : __pyx_r = NULL;
11223 0 : __pyx_L0:;
11224 0 : __Pyx_XGIVEREF(__pyx_r);
11225 0 : __Pyx_RefNannyFinishContext();
11226 0 : return __pyx_r;
11227 : }
11228 :
11229 : /* "View.MemoryView":624
11230 : *
11231 : *
11232 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11233 : * cdef __Pyx_memviewslice *mslice
11234 : * cdef __Pyx_memviewslice tmp
11235 : */
11236 :
11237 : /* Python wrapper */
11238 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11239 : #if CYTHON_METH_FASTCALL
11240 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11241 : #else
11242 : PyObject *__pyx_args, PyObject *__pyx_kwds
11243 : #endif
11244 : ); /*proto*/
11245 0 : static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self,
11246 : #if CYTHON_METH_FASTCALL
11247 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11248 : #else
11249 : PyObject *__pyx_args, PyObject *__pyx_kwds
11250 : #endif
11251 : ) {
11252 : #if !CYTHON_METH_FASTCALL
11253 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11254 : #endif
11255 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11256 0 : PyObject *__pyx_r = 0;
11257 : __Pyx_RefNannyDeclarations
11258 0 : __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
11259 : #if !CYTHON_METH_FASTCALL
11260 : #if CYTHON_ASSUME_SAFE_MACROS
11261 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11262 : #else
11263 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11264 : #endif
11265 : #endif
11266 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11267 0 : if (unlikely(__pyx_nargs > 0)) {
11268 0 : __Pyx_RaiseArgtupleInvalid("is_c_contig", 1, 0, 0, __pyx_nargs); return NULL;}
11269 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_c_contig", 0))) return NULL;
11270 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11271 :
11272 : /* function exit code */
11273 0 : __Pyx_RefNannyFinishContext();
11274 0 : return __pyx_r;
11275 : }
11276 :
11277 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11278 0 : __Pyx_memviewslice *__pyx_v_mslice;
11279 0 : __Pyx_memviewslice __pyx_v_tmp;
11280 0 : PyObject *__pyx_r = NULL;
11281 : __Pyx_RefNannyDeclarations
11282 0 : __Pyx_memviewslice *__pyx_t_1;
11283 0 : PyObject *__pyx_t_2 = NULL;
11284 0 : int __pyx_lineno = 0;
11285 0 : const char *__pyx_filename = NULL;
11286 0 : int __pyx_clineno = 0;
11287 0 : __Pyx_RefNannySetupContext("is_c_contig", 1);
11288 :
11289 : /* "View.MemoryView":627
11290 : * cdef __Pyx_memviewslice *mslice
11291 : * cdef __Pyx_memviewslice tmp
11292 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11293 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11294 : *
11295 : */
11296 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 627, __pyx_L1_error)
11297 0 : __pyx_v_mslice = __pyx_t_1;
11298 :
11299 : /* "View.MemoryView":628
11300 : * cdef __Pyx_memviewslice tmp
11301 : * mslice = get_slice_from_memview(self, &tmp)
11302 : * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
11303 : *
11304 : * def is_f_contig(self):
11305 : */
11306 0 : __Pyx_XDECREF(__pyx_r);
11307 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 628, __pyx_L1_error)
11308 0 : __Pyx_GOTREF(__pyx_t_2);
11309 0 : __pyx_r = __pyx_t_2;
11310 0 : __pyx_t_2 = 0;
11311 0 : goto __pyx_L0;
11312 :
11313 : /* "View.MemoryView":624
11314 : *
11315 : *
11316 : * def is_c_contig(self): # <<<<<<<<<<<<<<
11317 : * cdef __Pyx_memviewslice *mslice
11318 : * cdef __Pyx_memviewslice tmp
11319 : */
11320 :
11321 : /* function exit code */
11322 0 : __pyx_L1_error:;
11323 0 : __Pyx_XDECREF(__pyx_t_2);
11324 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11325 0 : __pyx_r = NULL;
11326 0 : __pyx_L0:;
11327 0 : __Pyx_XGIVEREF(__pyx_r);
11328 0 : __Pyx_RefNannyFinishContext();
11329 0 : return __pyx_r;
11330 : }
11331 :
11332 : /* "View.MemoryView":630
11333 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11334 : *
11335 : * def is_f_contig(self): # <<<<<<<<<<<<<<
11336 : * cdef __Pyx_memviewslice *mslice
11337 : * cdef __Pyx_memviewslice tmp
11338 : */
11339 :
11340 : /* Python wrapper */
11341 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11342 : #if CYTHON_METH_FASTCALL
11343 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11344 : #else
11345 : PyObject *__pyx_args, PyObject *__pyx_kwds
11346 : #endif
11347 : ); /*proto*/
11348 0 : static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self,
11349 : #if CYTHON_METH_FASTCALL
11350 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11351 : #else
11352 : PyObject *__pyx_args, PyObject *__pyx_kwds
11353 : #endif
11354 : ) {
11355 : #if !CYTHON_METH_FASTCALL
11356 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11357 : #endif
11358 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11359 0 : PyObject *__pyx_r = 0;
11360 : __Pyx_RefNannyDeclarations
11361 0 : __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
11362 : #if !CYTHON_METH_FASTCALL
11363 : #if CYTHON_ASSUME_SAFE_MACROS
11364 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11365 : #else
11366 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11367 : #endif
11368 : #endif
11369 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11370 0 : if (unlikely(__pyx_nargs > 0)) {
11371 0 : __Pyx_RaiseArgtupleInvalid("is_f_contig", 1, 0, 0, __pyx_nargs); return NULL;}
11372 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "is_f_contig", 0))) return NULL;
11373 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
11374 :
11375 : /* function exit code */
11376 0 : __Pyx_RefNannyFinishContext();
11377 0 : return __pyx_r;
11378 : }
11379 :
11380 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
11381 0 : __Pyx_memviewslice *__pyx_v_mslice;
11382 0 : __Pyx_memviewslice __pyx_v_tmp;
11383 0 : PyObject *__pyx_r = NULL;
11384 : __Pyx_RefNannyDeclarations
11385 0 : __Pyx_memviewslice *__pyx_t_1;
11386 0 : PyObject *__pyx_t_2 = NULL;
11387 0 : int __pyx_lineno = 0;
11388 0 : const char *__pyx_filename = NULL;
11389 0 : int __pyx_clineno = 0;
11390 0 : __Pyx_RefNannySetupContext("is_f_contig", 1);
11391 :
11392 : /* "View.MemoryView":633
11393 : * cdef __Pyx_memviewslice *mslice
11394 : * cdef __Pyx_memviewslice tmp
11395 : * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
11396 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11397 : *
11398 : */
11399 0 : __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 633, __pyx_L1_error)
11400 0 : __pyx_v_mslice = __pyx_t_1;
11401 :
11402 : /* "View.MemoryView":634
11403 : * cdef __Pyx_memviewslice tmp
11404 : * mslice = get_slice_from_memview(self, &tmp)
11405 : * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
11406 : *
11407 : * def copy(self):
11408 : */
11409 0 : __Pyx_XDECREF(__pyx_r);
11410 0 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
11411 0 : __Pyx_GOTREF(__pyx_t_2);
11412 0 : __pyx_r = __pyx_t_2;
11413 0 : __pyx_t_2 = 0;
11414 0 : goto __pyx_L0;
11415 :
11416 : /* "View.MemoryView":630
11417 : * return slice_is_contig(mslice[0], 'C', self.view.ndim)
11418 : *
11419 : * def is_f_contig(self): # <<<<<<<<<<<<<<
11420 : * cdef __Pyx_memviewslice *mslice
11421 : * cdef __Pyx_memviewslice tmp
11422 : */
11423 :
11424 : /* function exit code */
11425 0 : __pyx_L1_error:;
11426 0 : __Pyx_XDECREF(__pyx_t_2);
11427 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
11428 0 : __pyx_r = NULL;
11429 0 : __pyx_L0:;
11430 0 : __Pyx_XGIVEREF(__pyx_r);
11431 0 : __Pyx_RefNannyFinishContext();
11432 0 : return __pyx_r;
11433 : }
11434 :
11435 : /* "View.MemoryView":636
11436 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11437 : *
11438 : * def copy(self): # <<<<<<<<<<<<<<
11439 : * cdef __Pyx_memviewslice mslice
11440 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11441 : */
11442 :
11443 : /* Python wrapper */
11444 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11445 : #if CYTHON_METH_FASTCALL
11446 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11447 : #else
11448 : PyObject *__pyx_args, PyObject *__pyx_kwds
11449 : #endif
11450 : ); /*proto*/
11451 0 : static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self,
11452 : #if CYTHON_METH_FASTCALL
11453 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11454 : #else
11455 : PyObject *__pyx_args, PyObject *__pyx_kwds
11456 : #endif
11457 : ) {
11458 : #if !CYTHON_METH_FASTCALL
11459 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11460 : #endif
11461 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11462 0 : PyObject *__pyx_r = 0;
11463 : __Pyx_RefNannyDeclarations
11464 0 : __Pyx_RefNannySetupContext("copy (wrapper)", 0);
11465 : #if !CYTHON_METH_FASTCALL
11466 : #if CYTHON_ASSUME_SAFE_MACROS
11467 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11468 : #else
11469 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11470 : #endif
11471 : #endif
11472 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11473 0 : if (unlikely(__pyx_nargs > 0)) {
11474 0 : __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL;}
11475 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy", 0))) return NULL;
11476 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
11477 :
11478 : /* function exit code */
11479 0 : __Pyx_RefNannyFinishContext();
11480 0 : return __pyx_r;
11481 : }
11482 :
11483 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
11484 0 : __Pyx_memviewslice __pyx_v_mslice;
11485 0 : int __pyx_v_flags;
11486 0 : PyObject *__pyx_r = NULL;
11487 : __Pyx_RefNannyDeclarations
11488 0 : __Pyx_memviewslice __pyx_t_1;
11489 0 : PyObject *__pyx_t_2 = NULL;
11490 0 : int __pyx_lineno = 0;
11491 0 : const char *__pyx_filename = NULL;
11492 0 : int __pyx_clineno = 0;
11493 0 : __Pyx_RefNannySetupContext("copy", 1);
11494 :
11495 : /* "View.MemoryView":638
11496 : * def copy(self):
11497 : * cdef __Pyx_memviewslice mslice
11498 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
11499 : *
11500 : * slice_copy(self, &mslice)
11501 : */
11502 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
11503 :
11504 : /* "View.MemoryView":640
11505 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11506 : *
11507 : * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
11508 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
11509 : * self.view.itemsize,
11510 : */
11511 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
11512 :
11513 : /* "View.MemoryView":641
11514 : *
11515 : * slice_copy(self, &mslice)
11516 : * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
11517 : * self.view.itemsize,
11518 : * flags|PyBUF_C_CONTIGUOUS,
11519 : */
11520 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 641, __pyx_L1_error)
11521 0 : __pyx_v_mslice = __pyx_t_1;
11522 :
11523 : /* "View.MemoryView":646
11524 : * self.dtype_is_object)
11525 : *
11526 : * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
11527 : *
11528 : * def copy_fortran(self):
11529 : */
11530 0 : __Pyx_XDECREF(__pyx_r);
11531 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 646, __pyx_L1_error)
11532 0 : __Pyx_GOTREF(__pyx_t_2);
11533 0 : __pyx_r = __pyx_t_2;
11534 0 : __pyx_t_2 = 0;
11535 0 : goto __pyx_L0;
11536 :
11537 : /* "View.MemoryView":636
11538 : * return slice_is_contig(mslice[0], 'F', self.view.ndim)
11539 : *
11540 : * def copy(self): # <<<<<<<<<<<<<<
11541 : * cdef __Pyx_memviewslice mslice
11542 : * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
11543 : */
11544 :
11545 : /* function exit code */
11546 0 : __pyx_L1_error:;
11547 0 : __Pyx_XDECREF(__pyx_t_2);
11548 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
11549 0 : __pyx_r = NULL;
11550 0 : __pyx_L0:;
11551 0 : __Pyx_XGIVEREF(__pyx_r);
11552 0 : __Pyx_RefNannyFinishContext();
11553 0 : return __pyx_r;
11554 : }
11555 :
11556 : /* "View.MemoryView":648
11557 : * return memoryview_copy_from_slice(self, &mslice)
11558 : *
11559 : * def copy_fortran(self): # <<<<<<<<<<<<<<
11560 : * cdef __Pyx_memviewslice src, dst
11561 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11562 : */
11563 :
11564 : /* Python wrapper */
11565 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11566 : #if CYTHON_METH_FASTCALL
11567 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11568 : #else
11569 : PyObject *__pyx_args, PyObject *__pyx_kwds
11570 : #endif
11571 : ); /*proto*/
11572 0 : static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self,
11573 : #if CYTHON_METH_FASTCALL
11574 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11575 : #else
11576 : PyObject *__pyx_args, PyObject *__pyx_kwds
11577 : #endif
11578 : ) {
11579 : #if !CYTHON_METH_FASTCALL
11580 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11581 : #endif
11582 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11583 0 : PyObject *__pyx_r = 0;
11584 : __Pyx_RefNannyDeclarations
11585 0 : __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
11586 : #if !CYTHON_METH_FASTCALL
11587 : #if CYTHON_ASSUME_SAFE_MACROS
11588 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11589 : #else
11590 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11591 : #endif
11592 : #endif
11593 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11594 0 : if (unlikely(__pyx_nargs > 0)) {
11595 0 : __Pyx_RaiseArgtupleInvalid("copy_fortran", 1, 0, 0, __pyx_nargs); return NULL;}
11596 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "copy_fortran", 0))) return NULL;
11597 0 : __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
11598 :
11599 : /* function exit code */
11600 0 : __Pyx_RefNannyFinishContext();
11601 0 : return __pyx_r;
11602 : }
11603 :
11604 0 : static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
11605 0 : __Pyx_memviewslice __pyx_v_src;
11606 0 : __Pyx_memviewslice __pyx_v_dst;
11607 0 : int __pyx_v_flags;
11608 0 : PyObject *__pyx_r = NULL;
11609 : __Pyx_RefNannyDeclarations
11610 0 : __Pyx_memviewslice __pyx_t_1;
11611 0 : PyObject *__pyx_t_2 = NULL;
11612 0 : int __pyx_lineno = 0;
11613 0 : const char *__pyx_filename = NULL;
11614 0 : int __pyx_clineno = 0;
11615 0 : __Pyx_RefNannySetupContext("copy_fortran", 1);
11616 :
11617 : /* "View.MemoryView":650
11618 : * def copy_fortran(self):
11619 : * cdef __Pyx_memviewslice src, dst
11620 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
11621 : *
11622 : * slice_copy(self, &src)
11623 : */
11624 0 : __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
11625 :
11626 : /* "View.MemoryView":652
11627 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11628 : *
11629 : * slice_copy(self, &src) # <<<<<<<<<<<<<<
11630 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
11631 : * self.view.itemsize,
11632 : */
11633 0 : __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
11634 :
11635 : /* "View.MemoryView":653
11636 : *
11637 : * slice_copy(self, &src)
11638 : * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
11639 : * self.view.itemsize,
11640 : * flags|PyBUF_F_CONTIGUOUS,
11641 : */
11642 0 : __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 653, __pyx_L1_error)
11643 0 : __pyx_v_dst = __pyx_t_1;
11644 :
11645 : /* "View.MemoryView":658
11646 : * self.dtype_is_object)
11647 : *
11648 : * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
11649 : *
11650 : *
11651 : */
11652 0 : __Pyx_XDECREF(__pyx_r);
11653 0 : __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
11654 0 : __Pyx_GOTREF(__pyx_t_2);
11655 0 : __pyx_r = __pyx_t_2;
11656 0 : __pyx_t_2 = 0;
11657 0 : goto __pyx_L0;
11658 :
11659 : /* "View.MemoryView":648
11660 : * return memoryview_copy_from_slice(self, &mslice)
11661 : *
11662 : * def copy_fortran(self): # <<<<<<<<<<<<<<
11663 : * cdef __Pyx_memviewslice src, dst
11664 : * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
11665 : */
11666 :
11667 : /* function exit code */
11668 0 : __pyx_L1_error:;
11669 0 : __Pyx_XDECREF(__pyx_t_2);
11670 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
11671 0 : __pyx_r = NULL;
11672 0 : __pyx_L0:;
11673 0 : __Pyx_XGIVEREF(__pyx_r);
11674 0 : __Pyx_RefNannyFinishContext();
11675 0 : return __pyx_r;
11676 : }
11677 :
11678 : /* "(tree fragment)":1
11679 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11680 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11681 : * def __setstate_cython__(self, __pyx_state):
11682 : */
11683 :
11684 : /* Python wrapper */
11685 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11686 : #if CYTHON_METH_FASTCALL
11687 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11688 : #else
11689 : PyObject *__pyx_args, PyObject *__pyx_kwds
11690 : #endif
11691 : ); /*proto*/
11692 0 : static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self,
11693 : #if CYTHON_METH_FASTCALL
11694 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11695 : #else
11696 : PyObject *__pyx_args, PyObject *__pyx_kwds
11697 : #endif
11698 : ) {
11699 : #if !CYTHON_METH_FASTCALL
11700 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11701 : #endif
11702 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11703 0 : PyObject *__pyx_r = 0;
11704 : __Pyx_RefNannyDeclarations
11705 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11706 : #if !CYTHON_METH_FASTCALL
11707 : #if CYTHON_ASSUME_SAFE_MACROS
11708 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11709 : #else
11710 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11711 : #endif
11712 : #endif
11713 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11714 0 : if (unlikely(__pyx_nargs > 0)) {
11715 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
11716 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
11717 0 : __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
11718 :
11719 : /* function exit code */
11720 0 : __Pyx_RefNannyFinishContext();
11721 0 : return __pyx_r;
11722 : }
11723 :
11724 0 : static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
11725 0 : PyObject *__pyx_r = NULL;
11726 : __Pyx_RefNannyDeclarations
11727 0 : int __pyx_lineno = 0;
11728 0 : const char *__pyx_filename = NULL;
11729 0 : int __pyx_clineno = 0;
11730 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
11731 :
11732 : /* "(tree fragment)":2
11733 : * def __reduce_cython__(self):
11734 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
11735 : * def __setstate_cython__(self, __pyx_state):
11736 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11737 : */
11738 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
11739 0 : __PYX_ERR(1, 2, __pyx_L1_error)
11740 :
11741 : /* "(tree fragment)":1
11742 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
11743 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11744 : * def __setstate_cython__(self, __pyx_state):
11745 : */
11746 :
11747 : /* function exit code */
11748 0 : __pyx_L1_error:;
11749 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11750 0 : __pyx_r = NULL;
11751 0 : __Pyx_XGIVEREF(__pyx_r);
11752 0 : __Pyx_RefNannyFinishContext();
11753 0 : return __pyx_r;
11754 : }
11755 :
11756 : /* "(tree fragment)":3
11757 : * def __reduce_cython__(self):
11758 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11759 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11760 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11761 : */
11762 :
11763 : /* Python wrapper */
11764 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
11765 : #if CYTHON_METH_FASTCALL
11766 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11767 : #else
11768 : PyObject *__pyx_args, PyObject *__pyx_kwds
11769 : #endif
11770 : ); /*proto*/
11771 0 : static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self,
11772 : #if CYTHON_METH_FASTCALL
11773 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
11774 : #else
11775 : PyObject *__pyx_args, PyObject *__pyx_kwds
11776 : #endif
11777 : ) {
11778 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
11779 : #if !CYTHON_METH_FASTCALL
11780 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
11781 : #endif
11782 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
11783 0 : PyObject* values[1] = {0};
11784 0 : int __pyx_lineno = 0;
11785 0 : const char *__pyx_filename = NULL;
11786 0 : int __pyx_clineno = 0;
11787 0 : PyObject *__pyx_r = 0;
11788 : __Pyx_RefNannyDeclarations
11789 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11790 : #if !CYTHON_METH_FASTCALL
11791 : #if CYTHON_ASSUME_SAFE_MACROS
11792 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
11793 : #else
11794 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
11795 : #endif
11796 : #endif
11797 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
11798 : {
11799 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
11800 0 : if (__pyx_kwds) {
11801 0 : Py_ssize_t kw_args;
11802 0 : switch (__pyx_nargs) {
11803 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
11804 0 : CYTHON_FALLTHROUGH;
11805 0 : case 0: break;
11806 0 : default: goto __pyx_L5_argtuple_error;
11807 : }
11808 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
11809 0 : switch (__pyx_nargs) {
11810 : case 0:
11811 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
11812 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
11813 0 : kw_args--;
11814 : }
11815 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
11816 0 : else goto __pyx_L5_argtuple_error;
11817 : }
11818 0 : if (unlikely(kw_args > 0)) {
11819 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
11820 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
11821 : }
11822 0 : } else if (unlikely(__pyx_nargs != 1)) {
11823 0 : goto __pyx_L5_argtuple_error;
11824 : } else {
11825 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
11826 : }
11827 0 : __pyx_v___pyx_state = values[0];
11828 : }
11829 0 : goto __pyx_L6_skip;
11830 0 : __pyx_L5_argtuple_error:;
11831 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
11832 0 : __pyx_L6_skip:;
11833 0 : goto __pyx_L4_argument_unpacking_done;
11834 0 : __pyx_L3_error:;
11835 : {
11836 0 : Py_ssize_t __pyx_temp;
11837 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
11838 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
11839 : }
11840 : }
11841 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11842 0 : __Pyx_RefNannyFinishContext();
11843 0 : return NULL;
11844 0 : __pyx_L4_argument_unpacking_done:;
11845 0 : __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v___pyx_state);
11846 :
11847 : /* function exit code */
11848 : {
11849 0 : Py_ssize_t __pyx_temp;
11850 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
11851 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
11852 : }
11853 : }
11854 : __Pyx_RefNannyFinishContext();
11855 : return __pyx_r;
11856 : }
11857 :
11858 0 : static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
11859 0 : PyObject *__pyx_r = NULL;
11860 : __Pyx_RefNannyDeclarations
11861 0 : int __pyx_lineno = 0;
11862 0 : const char *__pyx_filename = NULL;
11863 0 : int __pyx_clineno = 0;
11864 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
11865 :
11866 : /* "(tree fragment)":4
11867 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11868 : * def __setstate_cython__(self, __pyx_state):
11869 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
11870 : */
11871 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
11872 0 : __PYX_ERR(1, 4, __pyx_L1_error)
11873 :
11874 : /* "(tree fragment)":3
11875 : * def __reduce_cython__(self):
11876 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11877 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
11878 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
11879 : */
11880 :
11881 : /* function exit code */
11882 0 : __pyx_L1_error:;
11883 0 : __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11884 0 : __pyx_r = NULL;
11885 0 : __Pyx_XGIVEREF(__pyx_r);
11886 0 : __Pyx_RefNannyFinishContext();
11887 0 : return __pyx_r;
11888 : }
11889 :
11890 : /* "View.MemoryView":662
11891 : *
11892 : * @cname('__pyx_memoryview_new')
11893 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
11894 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11895 : * result.typeinfo = typeinfo
11896 : */
11897 :
11898 636 : static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
11899 636 : struct __pyx_memoryview_obj *__pyx_v_result = 0;
11900 636 : PyObject *__pyx_r = NULL;
11901 : __Pyx_RefNannyDeclarations
11902 636 : PyObject *__pyx_t_1 = NULL;
11903 636 : PyObject *__pyx_t_2 = NULL;
11904 636 : PyObject *__pyx_t_3 = NULL;
11905 636 : int __pyx_lineno = 0;
11906 636 : const char *__pyx_filename = NULL;
11907 636 : int __pyx_clineno = 0;
11908 636 : __Pyx_RefNannySetupContext("memoryview_cwrapper", 1);
11909 :
11910 : /* "View.MemoryView":663
11911 : * @cname('__pyx_memoryview_new')
11912 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
11913 : * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
11914 : * result.typeinfo = typeinfo
11915 : * return result
11916 : */
11917 636 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error)
11918 636 : __Pyx_GOTREF(__pyx_t_1);
11919 636 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
11920 636 : __Pyx_GOTREF(__pyx_t_2);
11921 636 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
11922 636 : __Pyx_GOTREF(__pyx_t_3);
11923 636 : __Pyx_INCREF(__pyx_v_o);
11924 636 : __Pyx_GIVEREF(__pyx_v_o);
11925 636 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o)) __PYX_ERR(1, 663, __pyx_L1_error);
11926 636 : __Pyx_GIVEREF(__pyx_t_1);
11927 636 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(1, 663, __pyx_L1_error);
11928 636 : __Pyx_GIVEREF(__pyx_t_2);
11929 636 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error);
11930 636 : __pyx_t_1 = 0;
11931 636 : __pyx_t_2 = 0;
11932 636 : __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 663, __pyx_L1_error)
11933 635 : __Pyx_GOTREF(__pyx_t_2);
11934 635 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11935 635 : __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
11936 635 : __pyx_t_2 = 0;
11937 :
11938 : /* "View.MemoryView":664
11939 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
11940 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11941 : * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
11942 : * return result
11943 : *
11944 : */
11945 635 : __pyx_v_result->typeinfo = __pyx_v_typeinfo;
11946 :
11947 : /* "View.MemoryView":665
11948 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11949 : * result.typeinfo = typeinfo
11950 : * return result # <<<<<<<<<<<<<<
11951 : *
11952 : * @cname('__pyx_memoryview_check')
11953 : */
11954 635 : __Pyx_XDECREF(__pyx_r);
11955 635 : __Pyx_INCREF((PyObject *)__pyx_v_result);
11956 635 : __pyx_r = ((PyObject *)__pyx_v_result);
11957 635 : goto __pyx_L0;
11958 :
11959 : /* "View.MemoryView":662
11960 : *
11961 : * @cname('__pyx_memoryview_new')
11962 : * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
11963 : * cdef memoryview result = memoryview(o, flags, dtype_is_object)
11964 : * result.typeinfo = typeinfo
11965 : */
11966 :
11967 : /* function exit code */
11968 1 : __pyx_L1_error:;
11969 1 : __Pyx_XDECREF(__pyx_t_1);
11970 1 : __Pyx_XDECREF(__pyx_t_2);
11971 1 : __Pyx_XDECREF(__pyx_t_3);
11972 1 : __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
11973 1 : __pyx_r = 0;
11974 636 : __pyx_L0:;
11975 636 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
11976 636 : __Pyx_XGIVEREF(__pyx_r);
11977 636 : __Pyx_RefNannyFinishContext();
11978 636 : return __pyx_r;
11979 : }
11980 :
11981 : /* "View.MemoryView":668
11982 : *
11983 : * @cname('__pyx_memoryview_check')
11984 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
11985 : * return isinstance(o, memoryview)
11986 : *
11987 : */
11988 :
11989 636 : static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
11990 636 : int __pyx_r;
11991 636 : int __pyx_t_1;
11992 :
11993 : /* "View.MemoryView":669
11994 : * @cname('__pyx_memoryview_check')
11995 : * cdef inline bint memoryview_check(object o) noexcept:
11996 : * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
11997 : *
11998 : * cdef tuple _unellipsify(object index, int ndim):
11999 : */
12000 636 : __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
12001 636 : __pyx_r = __pyx_t_1;
12002 636 : goto __pyx_L0;
12003 :
12004 : /* "View.MemoryView":668
12005 : *
12006 : * @cname('__pyx_memoryview_check')
12007 : * cdef inline bint memoryview_check(object o) noexcept: # <<<<<<<<<<<<<<
12008 : * return isinstance(o, memoryview)
12009 : *
12010 : */
12011 :
12012 : /* function exit code */
12013 636 : __pyx_L0:;
12014 636 : return __pyx_r;
12015 : }
12016 :
12017 : /* "View.MemoryView":671
12018 : * return isinstance(o, memoryview)
12019 : *
12020 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12021 : * """
12022 : * Replace all ellipses with full slices and fill incomplete indices with
12023 : */
12024 :
12025 0 : static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
12026 0 : Py_ssize_t __pyx_v_idx;
12027 0 : PyObject *__pyx_v_tup = NULL;
12028 0 : PyObject *__pyx_v_result = NULL;
12029 0 : int __pyx_v_have_slices;
12030 0 : int __pyx_v_seen_ellipsis;
12031 0 : PyObject *__pyx_v_item = NULL;
12032 0 : Py_ssize_t __pyx_v_nslices;
12033 0 : PyObject *__pyx_r = NULL;
12034 : __Pyx_RefNannyDeclarations
12035 0 : PyObject *__pyx_t_1 = NULL;
12036 0 : int __pyx_t_2;
12037 0 : PyObject *__pyx_t_3 = NULL;
12038 0 : Py_ssize_t __pyx_t_4;
12039 0 : Py_ssize_t __pyx_t_5;
12040 0 : Py_UCS4 __pyx_t_6;
12041 0 : PyObject *__pyx_t_7 = NULL;
12042 0 : int __pyx_lineno = 0;
12043 0 : const char *__pyx_filename = NULL;
12044 0 : int __pyx_clineno = 0;
12045 0 : __Pyx_RefNannySetupContext("_unellipsify", 1);
12046 :
12047 : /* "View.MemoryView":677
12048 : * """
12049 : * cdef Py_ssize_t idx
12050 : * tup = <tuple>index if isinstance(index, tuple) else (index,) # <<<<<<<<<<<<<<
12051 : *
12052 : * result = [slice(None)] * ndim
12053 : */
12054 0 : __pyx_t_2 = PyTuple_Check(__pyx_v_index);
12055 0 : if (__pyx_t_2) {
12056 0 : __Pyx_INCREF(((PyObject*)__pyx_v_index));
12057 : __pyx_t_1 = __pyx_v_index;
12058 : } else {
12059 0 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 677, __pyx_L1_error)
12060 0 : __Pyx_GOTREF(__pyx_t_3);
12061 0 : __Pyx_INCREF(__pyx_v_index);
12062 0 : __Pyx_GIVEREF(__pyx_v_index);
12063 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index)) __PYX_ERR(1, 677, __pyx_L1_error);
12064 0 : __pyx_t_1 = __pyx_t_3;
12065 0 : __pyx_t_3 = 0;
12066 : }
12067 0 : __pyx_v_tup = ((PyObject*)__pyx_t_1);
12068 0 : __pyx_t_1 = 0;
12069 :
12070 : /* "View.MemoryView":679
12071 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
12072 : *
12073 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
12074 : * have_slices = False
12075 : * seen_ellipsis = False
12076 : */
12077 0 : __pyx_t_1 = PyList_New(1 * ((__pyx_v_ndim<0) ? 0:__pyx_v_ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 679, __pyx_L1_error)
12078 : __Pyx_GOTREF(__pyx_t_1);
12079 : { Py_ssize_t __pyx_temp;
12080 0 : for (__pyx_temp=0; __pyx_temp < __pyx_v_ndim; __pyx_temp++) {
12081 0 : __Pyx_INCREF(__pyx_slice__5);
12082 0 : __Pyx_GIVEREF(__pyx_slice__5);
12083 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, __pyx_temp, __pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error);
12084 : }
12085 : }
12086 0 : __pyx_v_result = ((PyObject*)__pyx_t_1);
12087 0 : __pyx_t_1 = 0;
12088 :
12089 : /* "View.MemoryView":680
12090 : *
12091 : * result = [slice(None)] * ndim
12092 : * have_slices = False # <<<<<<<<<<<<<<
12093 : * seen_ellipsis = False
12094 : * idx = 0
12095 : */
12096 0 : __pyx_v_have_slices = 0;
12097 :
12098 : /* "View.MemoryView":681
12099 : * result = [slice(None)] * ndim
12100 : * have_slices = False
12101 : * seen_ellipsis = False # <<<<<<<<<<<<<<
12102 : * idx = 0
12103 : * for item in tup:
12104 : */
12105 0 : __pyx_v_seen_ellipsis = 0;
12106 :
12107 : /* "View.MemoryView":682
12108 : * have_slices = False
12109 : * seen_ellipsis = False
12110 : * idx = 0 # <<<<<<<<<<<<<<
12111 : * for item in tup:
12112 : * if item is Ellipsis:
12113 : */
12114 0 : __pyx_v_idx = 0;
12115 :
12116 : /* "View.MemoryView":683
12117 : * seen_ellipsis = False
12118 : * idx = 0
12119 : * for item in tup: # <<<<<<<<<<<<<<
12120 : * if item is Ellipsis:
12121 : * if not seen_ellipsis:
12122 : */
12123 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12124 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
12125 0 : __PYX_ERR(1, 683, __pyx_L1_error)
12126 : }
12127 0 : __pyx_t_1 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_1);
12128 : __pyx_t_4 = 0;
12129 0 : for (;;) {
12130 0 : {
12131 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
12132 : #if !CYTHON_ASSUME_SAFE_MACROS
12133 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12134 : #endif
12135 0 : if (__pyx_t_4 >= __pyx_temp) break;
12136 : }
12137 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12138 0 : __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(1, 683, __pyx_L1_error)
12139 : #else
12140 : __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
12141 : __Pyx_GOTREF(__pyx_t_3);
12142 : #endif
12143 0 : __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
12144 0 : __pyx_t_3 = 0;
12145 :
12146 : /* "View.MemoryView":684
12147 : * idx = 0
12148 : * for item in tup:
12149 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12150 : * if not seen_ellipsis:
12151 : * idx += ndim - len(tup)
12152 : */
12153 0 : __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
12154 0 : if (__pyx_t_2) {
12155 :
12156 : /* "View.MemoryView":685
12157 : * for item in tup:
12158 : * if item is Ellipsis:
12159 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12160 : * idx += ndim - len(tup)
12161 : * seen_ellipsis = True
12162 : */
12163 0 : __pyx_t_2 = (!__pyx_v_seen_ellipsis);
12164 0 : if (__pyx_t_2) {
12165 :
12166 : /* "View.MemoryView":686
12167 : * if item is Ellipsis:
12168 : * if not seen_ellipsis:
12169 : * idx += ndim - len(tup) # <<<<<<<<<<<<<<
12170 : * seen_ellipsis = True
12171 : * have_slices = True
12172 : */
12173 0 : if (unlikely(__pyx_v_tup == Py_None)) {
12174 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
12175 : __PYX_ERR(1, 686, __pyx_L1_error)
12176 : }
12177 0 : __pyx_t_5 = __Pyx_PyTuple_GET_SIZE(__pyx_v_tup); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 686, __pyx_L1_error)
12178 0 : __pyx_v_idx = (__pyx_v_idx + (__pyx_v_ndim - __pyx_t_5));
12179 :
12180 : /* "View.MemoryView":687
12181 : * if not seen_ellipsis:
12182 : * idx += ndim - len(tup)
12183 : * seen_ellipsis = True # <<<<<<<<<<<<<<
12184 : * have_slices = True
12185 : * else:
12186 : */
12187 0 : __pyx_v_seen_ellipsis = 1;
12188 :
12189 : /* "View.MemoryView":685
12190 : * for item in tup:
12191 : * if item is Ellipsis:
12192 : * if not seen_ellipsis: # <<<<<<<<<<<<<<
12193 : * idx += ndim - len(tup)
12194 : * seen_ellipsis = True
12195 : */
12196 : }
12197 :
12198 : /* "View.MemoryView":688
12199 : * idx += ndim - len(tup)
12200 : * seen_ellipsis = True
12201 : * have_slices = True # <<<<<<<<<<<<<<
12202 : * else:
12203 : * if isinstance(item, slice):
12204 : */
12205 0 : __pyx_v_have_slices = 1;
12206 :
12207 : /* "View.MemoryView":684
12208 : * idx = 0
12209 : * for item in tup:
12210 : * if item is Ellipsis: # <<<<<<<<<<<<<<
12211 : * if not seen_ellipsis:
12212 : * idx += ndim - len(tup)
12213 : */
12214 0 : goto __pyx_L5;
12215 : }
12216 :
12217 : /* "View.MemoryView":690
12218 : * have_slices = True
12219 : * else:
12220 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12221 : * have_slices = True
12222 : * elif not PyIndex_Check(item):
12223 : */
12224 : /*else*/ {
12225 0 : __pyx_t_2 = PySlice_Check(__pyx_v_item);
12226 0 : if (__pyx_t_2) {
12227 :
12228 : /* "View.MemoryView":691
12229 : * else:
12230 : * if isinstance(item, slice):
12231 : * have_slices = True # <<<<<<<<<<<<<<
12232 : * elif not PyIndex_Check(item):
12233 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12234 : */
12235 0 : __pyx_v_have_slices = 1;
12236 :
12237 : /* "View.MemoryView":690
12238 : * have_slices = True
12239 : * else:
12240 : * if isinstance(item, slice): # <<<<<<<<<<<<<<
12241 : * have_slices = True
12242 : * elif not PyIndex_Check(item):
12243 : */
12244 0 : goto __pyx_L7;
12245 : }
12246 :
12247 : /* "View.MemoryView":692
12248 : * if isinstance(item, slice):
12249 : * have_slices = True
12250 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
12251 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12252 : * result[idx] = item
12253 : */
12254 0 : __pyx_t_2 = (!(PyIndex_Check(__pyx_v_item) != 0));
12255 0 : if (unlikely(__pyx_t_2)) {
12256 :
12257 : /* "View.MemoryView":693
12258 : * have_slices = True
12259 : * elif not PyIndex_Check(item):
12260 : * raise TypeError, f"Cannot index with type '{type(item)}'" # <<<<<<<<<<<<<<
12261 : * result[idx] = item
12262 : * idx += 1
12263 : */
12264 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 693, __pyx_L1_error)
12265 0 : __Pyx_GOTREF(__pyx_t_3);
12266 0 : __pyx_t_5 = 0;
12267 0 : __pyx_t_6 = 127;
12268 0 : __Pyx_INCREF(__pyx_kp_u_Cannot_index_with_type);
12269 0 : __pyx_t_5 += 24;
12270 0 : __Pyx_GIVEREF(__pyx_kp_u_Cannot_index_with_type);
12271 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Cannot_index_with_type);
12272 0 : __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_item)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
12273 0 : __Pyx_GOTREF(__pyx_t_7);
12274 0 : __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
12275 0 : __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
12276 0 : __Pyx_GIVEREF(__pyx_t_7);
12277 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
12278 0 : __pyx_t_7 = 0;
12279 0 : __Pyx_INCREF(__pyx_kp_u__6);
12280 0 : __pyx_t_5 += 1;
12281 0 : __Pyx_GIVEREF(__pyx_kp_u__6);
12282 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__6);
12283 0 : __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 693, __pyx_L1_error)
12284 0 : __Pyx_GOTREF(__pyx_t_7);
12285 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12286 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_7, 0, 0);
12287 0 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12288 0 : __PYX_ERR(1, 693, __pyx_L1_error)
12289 :
12290 : /* "View.MemoryView":692
12291 : * if isinstance(item, slice):
12292 : * have_slices = True
12293 : * elif not PyIndex_Check(item): # <<<<<<<<<<<<<<
12294 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12295 : * result[idx] = item
12296 : */
12297 : }
12298 0 : __pyx_L7:;
12299 :
12300 : /* "View.MemoryView":694
12301 : * elif not PyIndex_Check(item):
12302 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12303 : * result[idx] = item # <<<<<<<<<<<<<<
12304 : * idx += 1
12305 : *
12306 : */
12307 0 : if (unlikely((__Pyx_SetItemInt(__pyx_v_result, __pyx_v_idx, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(1, 694, __pyx_L1_error)
12308 : }
12309 0 : __pyx_L5:;
12310 :
12311 : /* "View.MemoryView":695
12312 : * raise TypeError, f"Cannot index with type '{type(item)}'"
12313 : * result[idx] = item
12314 : * idx += 1 # <<<<<<<<<<<<<<
12315 : *
12316 : * nslices = ndim - idx
12317 : */
12318 0 : __pyx_v_idx = (__pyx_v_idx + 1);
12319 :
12320 : /* "View.MemoryView":683
12321 : * seen_ellipsis = False
12322 : * idx = 0
12323 : * for item in tup: # <<<<<<<<<<<<<<
12324 : * if item is Ellipsis:
12325 : * if not seen_ellipsis:
12326 : */
12327 : }
12328 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12329 :
12330 : /* "View.MemoryView":697
12331 : * idx += 1
12332 : *
12333 : * nslices = ndim - idx # <<<<<<<<<<<<<<
12334 : * return have_slices or nslices, tuple(result)
12335 : *
12336 : */
12337 0 : __pyx_v_nslices = (__pyx_v_ndim - __pyx_v_idx);
12338 :
12339 : /* "View.MemoryView":698
12340 : *
12341 : * nslices = ndim - idx
12342 : * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
12343 : *
12344 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12345 : */
12346 0 : __Pyx_XDECREF(__pyx_r);
12347 0 : if (!__pyx_v_have_slices) {
12348 0 : } else {
12349 0 : __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12350 0 : __Pyx_GOTREF(__pyx_t_7);
12351 0 : __pyx_t_1 = __pyx_t_7;
12352 0 : __pyx_t_7 = 0;
12353 0 : goto __pyx_L9_bool_binop_done;
12354 : }
12355 0 : __pyx_t_7 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12356 : __Pyx_GOTREF(__pyx_t_7);
12357 : __pyx_t_1 = __pyx_t_7;
12358 0 : __pyx_t_7 = 0;
12359 0 : __pyx_L9_bool_binop_done:;
12360 0 : __pyx_t_7 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error)
12361 0 : __Pyx_GOTREF(__pyx_t_7);
12362 0 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
12363 0 : __Pyx_GOTREF(__pyx_t_3);
12364 0 : __Pyx_GIVEREF(__pyx_t_1);
12365 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(1, 698, __pyx_L1_error);
12366 0 : __Pyx_GIVEREF(__pyx_t_7);
12367 0 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(1, 698, __pyx_L1_error);
12368 0 : __pyx_t_1 = 0;
12369 0 : __pyx_t_7 = 0;
12370 0 : __pyx_r = ((PyObject*)__pyx_t_3);
12371 0 : __pyx_t_3 = 0;
12372 0 : goto __pyx_L0;
12373 :
12374 : /* "View.MemoryView":671
12375 : * return isinstance(o, memoryview)
12376 : *
12377 : * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
12378 : * """
12379 : * Replace all ellipses with full slices and fill incomplete indices with
12380 : */
12381 :
12382 : /* function exit code */
12383 0 : __pyx_L1_error:;
12384 0 : __Pyx_XDECREF(__pyx_t_1);
12385 0 : __Pyx_XDECREF(__pyx_t_3);
12386 0 : __Pyx_XDECREF(__pyx_t_7);
12387 0 : __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
12388 0 : __pyx_r = 0;
12389 0 : __pyx_L0:;
12390 0 : __Pyx_XDECREF(__pyx_v_tup);
12391 0 : __Pyx_XDECREF(__pyx_v_result);
12392 0 : __Pyx_XDECREF(__pyx_v_item);
12393 0 : __Pyx_XGIVEREF(__pyx_r);
12394 0 : __Pyx_RefNannyFinishContext();
12395 0 : return __pyx_r;
12396 : }
12397 :
12398 : /* "View.MemoryView":700
12399 : * return have_slices or nslices, tuple(result)
12400 : *
12401 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
12402 : * for suboffset in suboffsets[:ndim]:
12403 : * if suboffset >= 0:
12404 : */
12405 :
12406 0 : static int assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
12407 0 : Py_ssize_t __pyx_v_suboffset;
12408 0 : int __pyx_r;
12409 0 : Py_ssize_t *__pyx_t_1;
12410 0 : Py_ssize_t *__pyx_t_2;
12411 0 : Py_ssize_t *__pyx_t_3;
12412 0 : int __pyx_t_4;
12413 0 : int __pyx_lineno = 0;
12414 0 : const char *__pyx_filename = NULL;
12415 0 : int __pyx_clineno = 0;
12416 :
12417 : /* "View.MemoryView":701
12418 : *
12419 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12420 : * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
12421 : * if suboffset >= 0:
12422 : * raise ValueError, "Indirect dimensions not supported"
12423 : */
12424 0 : __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
12425 0 : for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
12426 0 : __pyx_t_1 = __pyx_t_3;
12427 0 : __pyx_v_suboffset = (__pyx_t_1[0]);
12428 :
12429 : /* "View.MemoryView":702
12430 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12431 : * for suboffset in suboffsets[:ndim]:
12432 : * if suboffset >= 0: # <<<<<<<<<<<<<<
12433 : * raise ValueError, "Indirect dimensions not supported"
12434 : * return 0 # return type just used as an error flag
12435 : */
12436 0 : __pyx_t_4 = (__pyx_v_suboffset >= 0);
12437 0 : if (unlikely(__pyx_t_4)) {
12438 :
12439 : /* "View.MemoryView":703
12440 : * for suboffset in suboffsets[:ndim]:
12441 : * if suboffset >= 0:
12442 : * raise ValueError, "Indirect dimensions not supported" # <<<<<<<<<<<<<<
12443 : * return 0 # return type just used as an error flag
12444 : *
12445 : */
12446 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_Indirect_dimensions_not_supporte, 0, 0);
12447 0 : __PYX_ERR(1, 703, __pyx_L1_error)
12448 :
12449 : /* "View.MemoryView":702
12450 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1:
12451 : * for suboffset in suboffsets[:ndim]:
12452 : * if suboffset >= 0: # <<<<<<<<<<<<<<
12453 : * raise ValueError, "Indirect dimensions not supported"
12454 : * return 0 # return type just used as an error flag
12455 : */
12456 : }
12457 : }
12458 :
12459 : /* "View.MemoryView":704
12460 : * if suboffset >= 0:
12461 : * raise ValueError, "Indirect dimensions not supported"
12462 : * return 0 # return type just used as an error flag # <<<<<<<<<<<<<<
12463 : *
12464 : *
12465 : */
12466 0 : __pyx_r = 0;
12467 0 : goto __pyx_L0;
12468 :
12469 : /* "View.MemoryView":700
12470 : * return have_slices or nslices, tuple(result)
12471 : *
12472 : * cdef int assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim) except -1: # <<<<<<<<<<<<<<
12473 : * for suboffset in suboffsets[:ndim]:
12474 : * if suboffset >= 0:
12475 : */
12476 :
12477 : /* function exit code */
12478 0 : __pyx_L1_error:;
12479 0 : __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
12480 0 : __pyx_r = -1;
12481 0 : __pyx_L0:;
12482 0 : return __pyx_r;
12483 : }
12484 :
12485 : /* "View.MemoryView":711
12486 : *
12487 : * @cname('__pyx_memview_slice')
12488 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
12489 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
12490 : * cdef bint negative_step
12491 : */
12492 :
12493 0 : static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
12494 0 : int __pyx_v_new_ndim;
12495 0 : int __pyx_v_suboffset_dim;
12496 0 : int __pyx_v_dim;
12497 0 : __Pyx_memviewslice __pyx_v_src;
12498 0 : __Pyx_memviewslice __pyx_v_dst;
12499 0 : __Pyx_memviewslice *__pyx_v_p_src;
12500 0 : struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
12501 0 : __Pyx_memviewslice *__pyx_v_p_dst;
12502 0 : int *__pyx_v_p_suboffset_dim;
12503 0 : Py_ssize_t __pyx_v_start;
12504 0 : Py_ssize_t __pyx_v_stop;
12505 0 : Py_ssize_t __pyx_v_step;
12506 0 : Py_ssize_t __pyx_v_cindex;
12507 0 : int __pyx_v_have_start;
12508 0 : int __pyx_v_have_stop;
12509 0 : int __pyx_v_have_step;
12510 0 : PyObject *__pyx_v_index = NULL;
12511 0 : struct __pyx_memoryview_obj *__pyx_r = NULL;
12512 : __Pyx_RefNannyDeclarations
12513 0 : int __pyx_t_1;
12514 0 : PyObject *__pyx_t_2 = NULL;
12515 0 : struct __pyx_memoryview_obj *__pyx_t_3;
12516 0 : char *__pyx_t_4;
12517 0 : int __pyx_t_5;
12518 0 : Py_ssize_t __pyx_t_6;
12519 0 : PyObject *(*__pyx_t_7)(PyObject *);
12520 0 : PyObject *__pyx_t_8 = NULL;
12521 0 : Py_ssize_t __pyx_t_9;
12522 0 : int __pyx_t_10;
12523 0 : Py_ssize_t __pyx_t_11;
12524 0 : int __pyx_lineno = 0;
12525 0 : const char *__pyx_filename = NULL;
12526 0 : int __pyx_clineno = 0;
12527 0 : __Pyx_RefNannySetupContext("memview_slice", 1);
12528 :
12529 : /* "View.MemoryView":712
12530 : * @cname('__pyx_memview_slice')
12531 : * cdef memoryview memview_slice(memoryview memview, object indices):
12532 : * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
12533 : * cdef bint negative_step
12534 : * cdef __Pyx_memviewslice src, dst
12535 : */
12536 0 : __pyx_v_new_ndim = 0;
12537 0 : __pyx_v_suboffset_dim = -1;
12538 :
12539 : /* "View.MemoryView":719
12540 : *
12541 : *
12542 : * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
12543 : *
12544 : * cdef _memoryviewslice memviewsliceobj
12545 : */
12546 0 : (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
12547 :
12548 : /* "View.MemoryView":723
12549 : * cdef _memoryviewslice memviewsliceobj
12550 : *
12551 : * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
12552 : *
12553 : * if isinstance(memview, _memoryviewslice):
12554 : */
12555 : #ifndef CYTHON_WITHOUT_ASSERTIONS
12556 0 : if (unlikely(__pyx_assertions_enabled())) {
12557 0 : __pyx_t_1 = (__pyx_v_memview->view.ndim > 0);
12558 0 : if (unlikely(!__pyx_t_1)) {
12559 0 : __Pyx_Raise(__pyx_builtin_AssertionError, 0, 0, 0);
12560 0 : __PYX_ERR(1, 723, __pyx_L1_error)
12561 : }
12562 : }
12563 : #else
12564 : if ((1)); else __PYX_ERR(1, 723, __pyx_L1_error)
12565 : #endif
12566 :
12567 : /* "View.MemoryView":725
12568 : * assert memview.view.ndim > 0
12569 : *
12570 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12571 : * memviewsliceobj = memview
12572 : * p_src = &memviewsliceobj.from_slice
12573 : */
12574 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12575 0 : if (__pyx_t_1) {
12576 :
12577 : /* "View.MemoryView":726
12578 : *
12579 : * if isinstance(memview, _memoryviewslice):
12580 : * memviewsliceobj = memview # <<<<<<<<<<<<<<
12581 : * p_src = &memviewsliceobj.from_slice
12582 : * else:
12583 : */
12584 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 726, __pyx_L1_error)
12585 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
12586 0 : __Pyx_INCREF(__pyx_t_2);
12587 0 : __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
12588 0 : __pyx_t_2 = 0;
12589 :
12590 : /* "View.MemoryView":727
12591 : * if isinstance(memview, _memoryviewslice):
12592 : * memviewsliceobj = memview
12593 : * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
12594 : * else:
12595 : * slice_copy(memview, &src)
12596 : */
12597 0 : __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
12598 :
12599 : /* "View.MemoryView":725
12600 : * assert memview.view.ndim > 0
12601 : *
12602 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12603 : * memviewsliceobj = memview
12604 : * p_src = &memviewsliceobj.from_slice
12605 : */
12606 0 : goto __pyx_L3;
12607 : }
12608 :
12609 : /* "View.MemoryView":729
12610 : * p_src = &memviewsliceobj.from_slice
12611 : * else:
12612 : * slice_copy(memview, &src) # <<<<<<<<<<<<<<
12613 : * p_src = &src
12614 : *
12615 : */
12616 : /*else*/ {
12617 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
12618 :
12619 : /* "View.MemoryView":730
12620 : * else:
12621 : * slice_copy(memview, &src)
12622 : * p_src = &src # <<<<<<<<<<<<<<
12623 : *
12624 : *
12625 : */
12626 0 : __pyx_v_p_src = (&__pyx_v_src);
12627 : }
12628 0 : __pyx_L3:;
12629 :
12630 : /* "View.MemoryView":736
12631 : *
12632 : *
12633 : * dst.memview = p_src.memview # <<<<<<<<<<<<<<
12634 : * dst.data = p_src.data
12635 : *
12636 : */
12637 0 : __pyx_t_3 = __pyx_v_p_src->memview;
12638 0 : __pyx_v_dst.memview = __pyx_t_3;
12639 :
12640 : /* "View.MemoryView":737
12641 : *
12642 : * dst.memview = p_src.memview
12643 : * dst.data = p_src.data # <<<<<<<<<<<<<<
12644 : *
12645 : *
12646 : */
12647 0 : __pyx_t_4 = __pyx_v_p_src->data;
12648 0 : __pyx_v_dst.data = __pyx_t_4;
12649 :
12650 : /* "View.MemoryView":742
12651 : *
12652 : *
12653 : * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
12654 : * cdef int *p_suboffset_dim = &suboffset_dim
12655 : * cdef Py_ssize_t start, stop, step, cindex
12656 : */
12657 0 : __pyx_v_p_dst = (&__pyx_v_dst);
12658 :
12659 : /* "View.MemoryView":743
12660 : *
12661 : * cdef __Pyx_memviewslice *p_dst = &dst
12662 : * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
12663 : * cdef Py_ssize_t start, stop, step, cindex
12664 : * cdef bint have_start, have_stop, have_step
12665 : */
12666 0 : __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
12667 :
12668 : /* "View.MemoryView":747
12669 : * cdef bint have_start, have_stop, have_step
12670 : *
12671 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
12672 : * if PyIndex_Check(index):
12673 : * cindex = index
12674 : */
12675 0 : __pyx_t_5 = 0;
12676 0 : if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
12677 0 : __pyx_t_2 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_2);
12678 0 : __pyx_t_6 = 0;
12679 0 : __pyx_t_7 = NULL;
12680 : } else {
12681 0 : __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 747, __pyx_L1_error)
12682 0 : __Pyx_GOTREF(__pyx_t_2);
12683 0 : __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 747, __pyx_L1_error)
12684 : }
12685 0 : for (;;) {
12686 0 : if (likely(!__pyx_t_7)) {
12687 0 : if (likely(PyList_CheckExact(__pyx_t_2))) {
12688 : {
12689 0 : Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
12690 : #if !CYTHON_ASSUME_SAFE_MACROS
12691 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12692 : #endif
12693 0 : if (__pyx_t_6 >= __pyx_temp) break;
12694 : }
12695 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12696 0 : __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12697 : #else
12698 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
12699 : __Pyx_GOTREF(__pyx_t_8);
12700 : #endif
12701 : } else {
12702 : {
12703 0 : Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
12704 : #if !CYTHON_ASSUME_SAFE_MACROS
12705 : if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12706 : #endif
12707 0 : if (__pyx_t_6 >= __pyx_temp) break;
12708 : }
12709 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12710 0 : __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(1, 747, __pyx_L1_error)
12711 : #else
12712 : __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 747, __pyx_L1_error)
12713 : __Pyx_GOTREF(__pyx_t_8);
12714 : #endif
12715 : }
12716 : } else {
12717 0 : __pyx_t_8 = __pyx_t_7(__pyx_t_2);
12718 0 : if (unlikely(!__pyx_t_8)) {
12719 0 : PyObject* exc_type = PyErr_Occurred();
12720 0 : if (exc_type) {
12721 0 : if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
12722 0 : else __PYX_ERR(1, 747, __pyx_L1_error)
12723 : }
12724 : break;
12725 : }
12726 0 : __Pyx_GOTREF(__pyx_t_8);
12727 : }
12728 0 : __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_8);
12729 0 : __pyx_t_8 = 0;
12730 0 : __pyx_v_dim = __pyx_t_5;
12731 0 : __pyx_t_5 = (__pyx_t_5 + 1);
12732 :
12733 : /* "View.MemoryView":748
12734 : *
12735 : * for dim, index in enumerate(indices):
12736 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12737 : * cindex = index
12738 : * slice_memviewslice(
12739 : */
12740 0 : __pyx_t_1 = (PyIndex_Check(__pyx_v_index) != 0);
12741 0 : if (__pyx_t_1) {
12742 :
12743 : /* "View.MemoryView":749
12744 : * for dim, index in enumerate(indices):
12745 : * if PyIndex_Check(index):
12746 : * cindex = index # <<<<<<<<<<<<<<
12747 : * slice_memviewslice(
12748 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12749 : */
12750 0 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 749, __pyx_L1_error)
12751 0 : __pyx_v_cindex = __pyx_t_9;
12752 :
12753 : /* "View.MemoryView":750
12754 : * if PyIndex_Check(index):
12755 : * cindex = index
12756 : * slice_memviewslice( # <<<<<<<<<<<<<<
12757 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12758 : * dim, new_ndim, p_suboffset_dim,
12759 : */
12760 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_cindex, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 750, __pyx_L1_error)
12761 :
12762 : /* "View.MemoryView":748
12763 : *
12764 : * for dim, index in enumerate(indices):
12765 : * if PyIndex_Check(index): # <<<<<<<<<<<<<<
12766 : * cindex = index
12767 : * slice_memviewslice(
12768 : */
12769 0 : goto __pyx_L6;
12770 : }
12771 :
12772 : /* "View.MemoryView":756
12773 : * 0, 0, 0, # have_{start,stop,step}
12774 : * False)
12775 : * elif index is None: # <<<<<<<<<<<<<<
12776 : * p_dst.shape[new_ndim] = 1
12777 : * p_dst.strides[new_ndim] = 0
12778 : */
12779 0 : __pyx_t_1 = (__pyx_v_index == Py_None);
12780 0 : if (__pyx_t_1) {
12781 :
12782 : /* "View.MemoryView":757
12783 : * False)
12784 : * elif index is None:
12785 : * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
12786 : * p_dst.strides[new_ndim] = 0
12787 : * p_dst.suboffsets[new_ndim] = -1
12788 : */
12789 0 : (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
12790 :
12791 : /* "View.MemoryView":758
12792 : * elif index is None:
12793 : * p_dst.shape[new_ndim] = 1
12794 : * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
12795 : * p_dst.suboffsets[new_ndim] = -1
12796 : * new_ndim += 1
12797 : */
12798 0 : (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
12799 :
12800 : /* "View.MemoryView":759
12801 : * p_dst.shape[new_ndim] = 1
12802 : * p_dst.strides[new_ndim] = 0
12803 : * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
12804 : * new_ndim += 1
12805 : * else:
12806 : */
12807 0 : (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
12808 :
12809 : /* "View.MemoryView":760
12810 : * p_dst.strides[new_ndim] = 0
12811 : * p_dst.suboffsets[new_ndim] = -1
12812 : * new_ndim += 1 # <<<<<<<<<<<<<<
12813 : * else:
12814 : * start = index.start or 0
12815 : */
12816 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
12817 :
12818 : /* "View.MemoryView":756
12819 : * 0, 0, 0, # have_{start,stop,step}
12820 : * False)
12821 : * elif index is None: # <<<<<<<<<<<<<<
12822 : * p_dst.shape[new_ndim] = 1
12823 : * p_dst.strides[new_ndim] = 0
12824 : */
12825 0 : goto __pyx_L6;
12826 : }
12827 :
12828 : /* "View.MemoryView":762
12829 : * new_ndim += 1
12830 : * else:
12831 : * start = index.start or 0 # <<<<<<<<<<<<<<
12832 : * stop = index.stop or 0
12833 : * step = index.step or 0
12834 : */
12835 : /*else*/ {
12836 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 762, __pyx_L1_error)
12837 0 : __Pyx_GOTREF(__pyx_t_8);
12838 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 762, __pyx_L1_error)
12839 0 : if (!__pyx_t_1) {
12840 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12841 : } else {
12842 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
12843 0 : __pyx_t_9 = __pyx_t_11;
12844 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12845 0 : goto __pyx_L7_bool_binop_done;
12846 : }
12847 : __pyx_t_9 = 0;
12848 0 : __pyx_L7_bool_binop_done:;
12849 0 : __pyx_v_start = __pyx_t_9;
12850 :
12851 : /* "View.MemoryView":763
12852 : * else:
12853 : * start = index.start or 0
12854 : * stop = index.stop or 0 # <<<<<<<<<<<<<<
12855 : * step = index.step or 0
12856 : *
12857 : */
12858 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 763, __pyx_L1_error)
12859 0 : __Pyx_GOTREF(__pyx_t_8);
12860 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 763, __pyx_L1_error)
12861 0 : if (!__pyx_t_1) {
12862 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12863 : } else {
12864 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 763, __pyx_L1_error)
12865 0 : __pyx_t_9 = __pyx_t_11;
12866 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12867 0 : goto __pyx_L9_bool_binop_done;
12868 : }
12869 : __pyx_t_9 = 0;
12870 0 : __pyx_L9_bool_binop_done:;
12871 0 : __pyx_v_stop = __pyx_t_9;
12872 :
12873 : /* "View.MemoryView":764
12874 : * start = index.start or 0
12875 : * stop = index.stop or 0
12876 : * step = index.step or 0 # <<<<<<<<<<<<<<
12877 : *
12878 : * have_start = index.start is not None
12879 : */
12880 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 764, __pyx_L1_error)
12881 0 : __Pyx_GOTREF(__pyx_t_8);
12882 0 : __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(1, 764, __pyx_L1_error)
12883 0 : if (!__pyx_t_1) {
12884 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12885 : } else {
12886 0 : __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 764, __pyx_L1_error)
12887 0 : __pyx_t_9 = __pyx_t_11;
12888 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12889 0 : goto __pyx_L11_bool_binop_done;
12890 : }
12891 : __pyx_t_9 = 0;
12892 0 : __pyx_L11_bool_binop_done:;
12893 0 : __pyx_v_step = __pyx_t_9;
12894 :
12895 : /* "View.MemoryView":766
12896 : * step = index.step or 0
12897 : *
12898 : * have_start = index.start is not None # <<<<<<<<<<<<<<
12899 : * have_stop = index.stop is not None
12900 : * have_step = index.step is not None
12901 : */
12902 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 766, __pyx_L1_error)
12903 0 : __Pyx_GOTREF(__pyx_t_8);
12904 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
12905 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12906 0 : __pyx_v_have_start = __pyx_t_1;
12907 :
12908 : /* "View.MemoryView":767
12909 : *
12910 : * have_start = index.start is not None
12911 : * have_stop = index.stop is not None # <<<<<<<<<<<<<<
12912 : * have_step = index.step is not None
12913 : *
12914 : */
12915 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 767, __pyx_L1_error)
12916 0 : __Pyx_GOTREF(__pyx_t_8);
12917 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
12918 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12919 0 : __pyx_v_have_stop = __pyx_t_1;
12920 :
12921 : /* "View.MemoryView":768
12922 : * have_start = index.start is not None
12923 : * have_stop = index.stop is not None
12924 : * have_step = index.step is not None # <<<<<<<<<<<<<<
12925 : *
12926 : * slice_memviewslice(
12927 : */
12928 0 : __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 768, __pyx_L1_error)
12929 0 : __Pyx_GOTREF(__pyx_t_8);
12930 0 : __pyx_t_1 = (__pyx_t_8 != Py_None);
12931 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12932 0 : __pyx_v_have_step = __pyx_t_1;
12933 :
12934 : /* "View.MemoryView":770
12935 : * have_step = index.step is not None
12936 : *
12937 : * slice_memviewslice( # <<<<<<<<<<<<<<
12938 : * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
12939 : * dim, new_ndim, p_suboffset_dim,
12940 : */
12941 0 : __pyx_t_10 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(1, 770, __pyx_L1_error)
12942 :
12943 : /* "View.MemoryView":776
12944 : * have_start, have_stop, have_step,
12945 : * True)
12946 : * new_ndim += 1 # <<<<<<<<<<<<<<
12947 : *
12948 : * if isinstance(memview, _memoryviewslice):
12949 : */
12950 0 : __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
12951 : }
12952 0 : __pyx_L6:;
12953 :
12954 : /* "View.MemoryView":747
12955 : * cdef bint have_start, have_stop, have_step
12956 : *
12957 : * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
12958 : * if PyIndex_Check(index):
12959 : * cindex = index
12960 : */
12961 : }
12962 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12963 :
12964 : /* "View.MemoryView":778
12965 : * new_ndim += 1
12966 : *
12967 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
12968 : * return memoryview_fromslice(dst, new_ndim,
12969 : * memviewsliceobj.to_object_func,
12970 : */
12971 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
12972 0 : if (__pyx_t_1) {
12973 :
12974 : /* "View.MemoryView":779
12975 : *
12976 : * if isinstance(memview, _memoryviewslice):
12977 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
12978 : * memviewsliceobj.to_object_func,
12979 : * memviewsliceobj.to_dtype_func,
12980 : */
12981 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
12982 :
12983 : /* "View.MemoryView":780
12984 : * if isinstance(memview, _memoryviewslice):
12985 : * return memoryview_fromslice(dst, new_ndim,
12986 : * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
12987 : * memviewsliceobj.to_dtype_func,
12988 : * memview.dtype_is_object)
12989 : */
12990 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 780, __pyx_L1_error) }
12991 :
12992 : /* "View.MemoryView":781
12993 : * return memoryview_fromslice(dst, new_ndim,
12994 : * memviewsliceobj.to_object_func,
12995 : * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
12996 : * memview.dtype_is_object)
12997 : * else:
12998 : */
12999 0 : if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 781, __pyx_L1_error) }
13000 :
13001 : /* "View.MemoryView":779
13002 : *
13003 : * if isinstance(memview, _memoryviewslice):
13004 : * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
13005 : * memviewsliceobj.to_object_func,
13006 : * memviewsliceobj.to_dtype_func,
13007 : */
13008 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 779, __pyx_L1_error)
13009 0 : __Pyx_GOTREF(__pyx_t_2);
13010 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 779, __pyx_L1_error)
13011 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13012 0 : __pyx_t_2 = 0;
13013 0 : goto __pyx_L0;
13014 :
13015 : /* "View.MemoryView":778
13016 : * new_ndim += 1
13017 : *
13018 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
13019 : * return memoryview_fromslice(dst, new_ndim,
13020 : * memviewsliceobj.to_object_func,
13021 : */
13022 : }
13023 :
13024 : /* "View.MemoryView":784
13025 : * memview.dtype_is_object)
13026 : * else:
13027 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13028 : * memview.dtype_is_object)
13029 : *
13030 : */
13031 : /*else*/ {
13032 0 : __Pyx_XDECREF((PyObject *)__pyx_r);
13033 :
13034 : /* "View.MemoryView":785
13035 : * else:
13036 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
13037 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
13038 : *
13039 : *
13040 : */
13041 0 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 784, __pyx_L1_error)
13042 0 : __Pyx_GOTREF(__pyx_t_2);
13043 :
13044 : /* "View.MemoryView":784
13045 : * memview.dtype_is_object)
13046 : * else:
13047 : * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
13048 : * memview.dtype_is_object)
13049 : *
13050 : */
13051 0 : if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_memoryview_type))))) __PYX_ERR(1, 784, __pyx_L1_error)
13052 0 : __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13053 0 : __pyx_t_2 = 0;
13054 0 : goto __pyx_L0;
13055 : }
13056 :
13057 : /* "View.MemoryView":711
13058 : *
13059 : * @cname('__pyx_memview_slice')
13060 : * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
13061 : * cdef int new_ndim = 0, suboffset_dim = -1, dim
13062 : * cdef bint negative_step
13063 : */
13064 :
13065 : /* function exit code */
13066 0 : __pyx_L1_error:;
13067 0 : __Pyx_XDECREF(__pyx_t_2);
13068 0 : __Pyx_XDECREF(__pyx_t_8);
13069 0 : __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13070 0 : __pyx_r = 0;
13071 0 : __pyx_L0:;
13072 0 : __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
13073 0 : __Pyx_XDECREF(__pyx_v_index);
13074 0 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
13075 0 : __Pyx_RefNannyFinishContext();
13076 0 : return __pyx_r;
13077 : }
13078 :
13079 : /* "View.MemoryView":793
13080 : *
13081 : * @cname('__pyx_memoryview_slice_memviewslice')
13082 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
13083 : * __Pyx_memviewslice *dst,
13084 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13085 : */
13086 :
13087 0 : static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
13088 0 : Py_ssize_t __pyx_v_new_shape;
13089 0 : int __pyx_v_negative_step;
13090 0 : int __pyx_r;
13091 0 : int __pyx_t_1;
13092 0 : int __pyx_t_2;
13093 0 : int __pyx_t_3;
13094 0 : int __pyx_lineno = 0;
13095 0 : const char *__pyx_filename = NULL;
13096 0 : int __pyx_clineno = 0;
13097 : #ifdef WITH_THREAD
13098 0 : PyGILState_STATE __pyx_gilstate_save;
13099 : #endif
13100 :
13101 : /* "View.MemoryView":813
13102 : * cdef bint negative_step
13103 : *
13104 : * if not is_slice: # <<<<<<<<<<<<<<
13105 : *
13106 : * if start < 0:
13107 : */
13108 0 : __pyx_t_1 = (!__pyx_v_is_slice);
13109 0 : if (__pyx_t_1) {
13110 :
13111 : /* "View.MemoryView":815
13112 : * if not is_slice:
13113 : *
13114 : * if start < 0: # <<<<<<<<<<<<<<
13115 : * start += shape
13116 : * if not 0 <= start < shape:
13117 : */
13118 0 : __pyx_t_1 = (__pyx_v_start < 0);
13119 0 : if (__pyx_t_1) {
13120 :
13121 : /* "View.MemoryView":816
13122 : *
13123 : * if start < 0:
13124 : * start += shape # <<<<<<<<<<<<<<
13125 : * if not 0 <= start < shape:
13126 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13127 : */
13128 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13129 :
13130 : /* "View.MemoryView":815
13131 : * if not is_slice:
13132 : *
13133 : * if start < 0: # <<<<<<<<<<<<<<
13134 : * start += shape
13135 : * if not 0 <= start < shape:
13136 : */
13137 : }
13138 :
13139 : /* "View.MemoryView":817
13140 : * if start < 0:
13141 : * start += shape
13142 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13143 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13144 : * else:
13145 : */
13146 0 : __pyx_t_1 = (0 <= __pyx_v_start);
13147 0 : if (__pyx_t_1) {
13148 0 : __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
13149 : }
13150 0 : __pyx_t_2 = (!__pyx_t_1);
13151 0 : if (__pyx_t_2) {
13152 :
13153 : /* "View.MemoryView":818
13154 : * start += shape
13155 : * if not 0 <= start < shape:
13156 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
13157 : * else:
13158 : *
13159 : */
13160 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 818, __pyx_L1_error)
13161 :
13162 : /* "View.MemoryView":817
13163 : * if start < 0:
13164 : * start += shape
13165 : * if not 0 <= start < shape: # <<<<<<<<<<<<<<
13166 : * _err_dim(PyExc_IndexError, "Index out of bounds (axis %d)", dim)
13167 : * else:
13168 : */
13169 : }
13170 :
13171 : /* "View.MemoryView":813
13172 : * cdef bint negative_step
13173 : *
13174 : * if not is_slice: # <<<<<<<<<<<<<<
13175 : *
13176 : * if start < 0:
13177 : */
13178 0 : goto __pyx_L3;
13179 : }
13180 :
13181 : /* "View.MemoryView":821
13182 : * else:
13183 : *
13184 : * if have_step: # <<<<<<<<<<<<<<
13185 : * negative_step = step < 0
13186 : * if step == 0:
13187 : */
13188 : /*else*/ {
13189 0 : __pyx_t_2 = (__pyx_v_have_step != 0);
13190 0 : if (__pyx_t_2) {
13191 :
13192 : /* "View.MemoryView":822
13193 : *
13194 : * if have_step:
13195 : * negative_step = step < 0 # <<<<<<<<<<<<<<
13196 : * if step == 0:
13197 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13198 : */
13199 0 : __pyx_v_negative_step = (__pyx_v_step < 0);
13200 :
13201 : /* "View.MemoryView":823
13202 : * if have_step:
13203 : * negative_step = step < 0
13204 : * if step == 0: # <<<<<<<<<<<<<<
13205 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13206 : * else:
13207 : */
13208 0 : __pyx_t_2 = (__pyx_v_step == 0);
13209 0 : if (__pyx_t_2) {
13210 :
13211 : /* "View.MemoryView":824
13212 : * negative_step = step < 0
13213 : * if step == 0:
13214 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
13215 : * else:
13216 : * negative_step = False
13217 : */
13218 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 824, __pyx_L1_error)
13219 :
13220 : /* "View.MemoryView":823
13221 : * if have_step:
13222 : * negative_step = step < 0
13223 : * if step == 0: # <<<<<<<<<<<<<<
13224 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13225 : * else:
13226 : */
13227 : }
13228 :
13229 : /* "View.MemoryView":821
13230 : * else:
13231 : *
13232 : * if have_step: # <<<<<<<<<<<<<<
13233 : * negative_step = step < 0
13234 : * if step == 0:
13235 : */
13236 0 : goto __pyx_L6;
13237 : }
13238 :
13239 : /* "View.MemoryView":826
13240 : * _err_dim(PyExc_ValueError, "Step may not be zero (axis %d)", dim)
13241 : * else:
13242 : * negative_step = False # <<<<<<<<<<<<<<
13243 : * step = 1
13244 : *
13245 : */
13246 : /*else*/ {
13247 : __pyx_v_negative_step = 0;
13248 :
13249 : /* "View.MemoryView":827
13250 : * else:
13251 : * negative_step = False
13252 : * step = 1 # <<<<<<<<<<<<<<
13253 : *
13254 : *
13255 : */
13256 : __pyx_v_step = 1;
13257 : }
13258 0 : __pyx_L6:;
13259 :
13260 : /* "View.MemoryView":830
13261 : *
13262 : *
13263 : * if have_start: # <<<<<<<<<<<<<<
13264 : * if start < 0:
13265 : * start += shape
13266 : */
13267 0 : __pyx_t_2 = (__pyx_v_have_start != 0);
13268 0 : if (__pyx_t_2) {
13269 :
13270 : /* "View.MemoryView":831
13271 : *
13272 : * if have_start:
13273 : * if start < 0: # <<<<<<<<<<<<<<
13274 : * start += shape
13275 : * if start < 0:
13276 : */
13277 0 : __pyx_t_2 = (__pyx_v_start < 0);
13278 0 : if (__pyx_t_2) {
13279 :
13280 : /* "View.MemoryView":832
13281 : * if have_start:
13282 : * if start < 0:
13283 : * start += shape # <<<<<<<<<<<<<<
13284 : * if start < 0:
13285 : * start = 0
13286 : */
13287 0 : __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
13288 :
13289 : /* "View.MemoryView":833
13290 : * if start < 0:
13291 : * start += shape
13292 : * if start < 0: # <<<<<<<<<<<<<<
13293 : * start = 0
13294 : * elif start >= shape:
13295 : */
13296 0 : __pyx_t_2 = (__pyx_v_start < 0);
13297 0 : if (__pyx_t_2) {
13298 :
13299 : /* "View.MemoryView":834
13300 : * start += shape
13301 : * if start < 0:
13302 : * start = 0 # <<<<<<<<<<<<<<
13303 : * elif start >= shape:
13304 : * if negative_step:
13305 : */
13306 : __pyx_v_start = 0;
13307 :
13308 : /* "View.MemoryView":833
13309 : * if start < 0:
13310 : * start += shape
13311 : * if start < 0: # <<<<<<<<<<<<<<
13312 : * start = 0
13313 : * elif start >= shape:
13314 : */
13315 : }
13316 :
13317 : /* "View.MemoryView":831
13318 : *
13319 : * if have_start:
13320 : * if start < 0: # <<<<<<<<<<<<<<
13321 : * start += shape
13322 : * if start < 0:
13323 : */
13324 0 : goto __pyx_L9;
13325 : }
13326 :
13327 : /* "View.MemoryView":835
13328 : * if start < 0:
13329 : * start = 0
13330 : * elif start >= shape: # <<<<<<<<<<<<<<
13331 : * if negative_step:
13332 : * start = shape - 1
13333 : */
13334 0 : __pyx_t_2 = (__pyx_v_start >= __pyx_v_shape);
13335 0 : if (__pyx_t_2) {
13336 :
13337 : /* "View.MemoryView":836
13338 : * start = 0
13339 : * elif start >= shape:
13340 : * if negative_step: # <<<<<<<<<<<<<<
13341 : * start = shape - 1
13342 : * else:
13343 : */
13344 0 : if (__pyx_v_negative_step) {
13345 :
13346 : /* "View.MemoryView":837
13347 : * elif start >= shape:
13348 : * if negative_step:
13349 : * start = shape - 1 # <<<<<<<<<<<<<<
13350 : * else:
13351 : * start = shape
13352 : */
13353 0 : __pyx_v_start = (__pyx_v_shape - 1);
13354 :
13355 : /* "View.MemoryView":836
13356 : * start = 0
13357 : * elif start >= shape:
13358 : * if negative_step: # <<<<<<<<<<<<<<
13359 : * start = shape - 1
13360 : * else:
13361 : */
13362 0 : goto __pyx_L11;
13363 : }
13364 :
13365 : /* "View.MemoryView":839
13366 : * start = shape - 1
13367 : * else:
13368 : * start = shape # <<<<<<<<<<<<<<
13369 : * else:
13370 : * if negative_step:
13371 : */
13372 : /*else*/ {
13373 : __pyx_v_start = __pyx_v_shape;
13374 : }
13375 0 : __pyx_L11:;
13376 :
13377 : /* "View.MemoryView":835
13378 : * if start < 0:
13379 : * start = 0
13380 : * elif start >= shape: # <<<<<<<<<<<<<<
13381 : * if negative_step:
13382 : * start = shape - 1
13383 : */
13384 : }
13385 0 : __pyx_L9:;
13386 :
13387 : /* "View.MemoryView":830
13388 : *
13389 : *
13390 : * if have_start: # <<<<<<<<<<<<<<
13391 : * if start < 0:
13392 : * start += shape
13393 : */
13394 0 : goto __pyx_L8;
13395 : }
13396 :
13397 : /* "View.MemoryView":841
13398 : * start = shape
13399 : * else:
13400 : * if negative_step: # <<<<<<<<<<<<<<
13401 : * start = shape - 1
13402 : * else:
13403 : */
13404 : /*else*/ {
13405 0 : if (__pyx_v_negative_step) {
13406 :
13407 : /* "View.MemoryView":842
13408 : * else:
13409 : * if negative_step:
13410 : * start = shape - 1 # <<<<<<<<<<<<<<
13411 : * else:
13412 : * start = 0
13413 : */
13414 0 : __pyx_v_start = (__pyx_v_shape - 1);
13415 :
13416 : /* "View.MemoryView":841
13417 : * start = shape
13418 : * else:
13419 : * if negative_step: # <<<<<<<<<<<<<<
13420 : * start = shape - 1
13421 : * else:
13422 : */
13423 0 : goto __pyx_L12;
13424 : }
13425 :
13426 : /* "View.MemoryView":844
13427 : * start = shape - 1
13428 : * else:
13429 : * start = 0 # <<<<<<<<<<<<<<
13430 : *
13431 : * if have_stop:
13432 : */
13433 : /*else*/ {
13434 : __pyx_v_start = 0;
13435 : }
13436 0 : __pyx_L12:;
13437 : }
13438 0 : __pyx_L8:;
13439 :
13440 : /* "View.MemoryView":846
13441 : * start = 0
13442 : *
13443 : * if have_stop: # <<<<<<<<<<<<<<
13444 : * if stop < 0:
13445 : * stop += shape
13446 : */
13447 0 : __pyx_t_2 = (__pyx_v_have_stop != 0);
13448 0 : if (__pyx_t_2) {
13449 :
13450 : /* "View.MemoryView":847
13451 : *
13452 : * if have_stop:
13453 : * if stop < 0: # <<<<<<<<<<<<<<
13454 : * stop += shape
13455 : * if stop < 0:
13456 : */
13457 0 : __pyx_t_2 = (__pyx_v_stop < 0);
13458 0 : if (__pyx_t_2) {
13459 :
13460 : /* "View.MemoryView":848
13461 : * if have_stop:
13462 : * if stop < 0:
13463 : * stop += shape # <<<<<<<<<<<<<<
13464 : * if stop < 0:
13465 : * stop = 0
13466 : */
13467 0 : __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
13468 :
13469 : /* "View.MemoryView":849
13470 : * if stop < 0:
13471 : * stop += shape
13472 : * if stop < 0: # <<<<<<<<<<<<<<
13473 : * stop = 0
13474 : * elif stop > shape:
13475 : */
13476 0 : __pyx_t_2 = (__pyx_v_stop < 0);
13477 0 : if (__pyx_t_2) {
13478 :
13479 : /* "View.MemoryView":850
13480 : * stop += shape
13481 : * if stop < 0:
13482 : * stop = 0 # <<<<<<<<<<<<<<
13483 : * elif stop > shape:
13484 : * stop = shape
13485 : */
13486 : __pyx_v_stop = 0;
13487 :
13488 : /* "View.MemoryView":849
13489 : * if stop < 0:
13490 : * stop += shape
13491 : * if stop < 0: # <<<<<<<<<<<<<<
13492 : * stop = 0
13493 : * elif stop > shape:
13494 : */
13495 : }
13496 :
13497 : /* "View.MemoryView":847
13498 : *
13499 : * if have_stop:
13500 : * if stop < 0: # <<<<<<<<<<<<<<
13501 : * stop += shape
13502 : * if stop < 0:
13503 : */
13504 0 : goto __pyx_L14;
13505 : }
13506 :
13507 : /* "View.MemoryView":851
13508 : * if stop < 0:
13509 : * stop = 0
13510 : * elif stop > shape: # <<<<<<<<<<<<<<
13511 : * stop = shape
13512 : * else:
13513 : */
13514 0 : __pyx_t_2 = (__pyx_v_stop > __pyx_v_shape);
13515 0 : if (__pyx_t_2) {
13516 :
13517 : /* "View.MemoryView":852
13518 : * stop = 0
13519 : * elif stop > shape:
13520 : * stop = shape # <<<<<<<<<<<<<<
13521 : * else:
13522 : * if negative_step:
13523 : */
13524 : __pyx_v_stop = __pyx_v_shape;
13525 :
13526 : /* "View.MemoryView":851
13527 : * if stop < 0:
13528 : * stop = 0
13529 : * elif stop > shape: # <<<<<<<<<<<<<<
13530 : * stop = shape
13531 : * else:
13532 : */
13533 : }
13534 0 : __pyx_L14:;
13535 :
13536 : /* "View.MemoryView":846
13537 : * start = 0
13538 : *
13539 : * if have_stop: # <<<<<<<<<<<<<<
13540 : * if stop < 0:
13541 : * stop += shape
13542 : */
13543 0 : goto __pyx_L13;
13544 : }
13545 :
13546 : /* "View.MemoryView":854
13547 : * stop = shape
13548 : * else:
13549 : * if negative_step: # <<<<<<<<<<<<<<
13550 : * stop = -1
13551 : * else:
13552 : */
13553 : /*else*/ {
13554 0 : if (__pyx_v_negative_step) {
13555 :
13556 : /* "View.MemoryView":855
13557 : * else:
13558 : * if negative_step:
13559 : * stop = -1 # <<<<<<<<<<<<<<
13560 : * else:
13561 : * stop = shape
13562 : */
13563 0 : __pyx_v_stop = -1L;
13564 :
13565 : /* "View.MemoryView":854
13566 : * stop = shape
13567 : * else:
13568 : * if negative_step: # <<<<<<<<<<<<<<
13569 : * stop = -1
13570 : * else:
13571 : */
13572 0 : goto __pyx_L16;
13573 : }
13574 :
13575 : /* "View.MemoryView":857
13576 : * stop = -1
13577 : * else:
13578 : * stop = shape # <<<<<<<<<<<<<<
13579 : *
13580 : *
13581 : */
13582 : /*else*/ {
13583 : __pyx_v_stop = __pyx_v_shape;
13584 : }
13585 0 : __pyx_L16:;
13586 : }
13587 0 : __pyx_L13:;
13588 :
13589 : /* "View.MemoryView":861
13590 : *
13591 : * with cython.cdivision(True):
13592 : * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
13593 : *
13594 : * if (stop - start) - step * new_shape:
13595 : */
13596 0 : __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
13597 :
13598 : /* "View.MemoryView":863
13599 : * new_shape = (stop - start) // step
13600 : *
13601 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13602 : * new_shape += 1
13603 : *
13604 : */
13605 0 : __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
13606 0 : if (__pyx_t_2) {
13607 :
13608 : /* "View.MemoryView":864
13609 : *
13610 : * if (stop - start) - step * new_shape:
13611 : * new_shape += 1 # <<<<<<<<<<<<<<
13612 : *
13613 : * if new_shape < 0:
13614 : */
13615 0 : __pyx_v_new_shape = (__pyx_v_new_shape + 1);
13616 :
13617 : /* "View.MemoryView":863
13618 : * new_shape = (stop - start) // step
13619 : *
13620 : * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
13621 : * new_shape += 1
13622 : *
13623 : */
13624 : }
13625 :
13626 : /* "View.MemoryView":866
13627 : * new_shape += 1
13628 : *
13629 : * if new_shape < 0: # <<<<<<<<<<<<<<
13630 : * new_shape = 0
13631 : *
13632 : */
13633 0 : __pyx_t_2 = (__pyx_v_new_shape < 0);
13634 0 : if (__pyx_t_2) {
13635 :
13636 : /* "View.MemoryView":867
13637 : *
13638 : * if new_shape < 0:
13639 : * new_shape = 0 # <<<<<<<<<<<<<<
13640 : *
13641 : *
13642 : */
13643 : __pyx_v_new_shape = 0;
13644 :
13645 : /* "View.MemoryView":866
13646 : * new_shape += 1
13647 : *
13648 : * if new_shape < 0: # <<<<<<<<<<<<<<
13649 : * new_shape = 0
13650 : *
13651 : */
13652 : }
13653 :
13654 : /* "View.MemoryView":870
13655 : *
13656 : *
13657 : * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
13658 : * dst.shape[new_ndim] = new_shape
13659 : * dst.suboffsets[new_ndim] = suboffset
13660 : */
13661 0 : (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
13662 :
13663 : /* "View.MemoryView":871
13664 : *
13665 : * dst.strides[new_ndim] = stride * step
13666 : * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
13667 : * dst.suboffsets[new_ndim] = suboffset
13668 : *
13669 : */
13670 0 : (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
13671 :
13672 : /* "View.MemoryView":872
13673 : * dst.strides[new_ndim] = stride * step
13674 : * dst.shape[new_ndim] = new_shape
13675 : * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
13676 : *
13677 : *
13678 : */
13679 0 : (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
13680 : }
13681 0 : __pyx_L3:;
13682 :
13683 : /* "View.MemoryView":875
13684 : *
13685 : *
13686 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13687 : * dst.data += start * stride
13688 : * else:
13689 : */
13690 0 : __pyx_t_2 = ((__pyx_v_suboffset_dim[0]) < 0);
13691 0 : if (__pyx_t_2) {
13692 :
13693 : /* "View.MemoryView":876
13694 : *
13695 : * if suboffset_dim[0] < 0:
13696 : * dst.data += start * stride # <<<<<<<<<<<<<<
13697 : * else:
13698 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13699 : */
13700 0 : __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
13701 :
13702 : /* "View.MemoryView":875
13703 : *
13704 : *
13705 : * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
13706 : * dst.data += start * stride
13707 : * else:
13708 : */
13709 0 : goto __pyx_L19;
13710 : }
13711 :
13712 : /* "View.MemoryView":878
13713 : * dst.data += start * stride
13714 : * else:
13715 : * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
13716 : *
13717 : * if suboffset >= 0:
13718 : */
13719 : /*else*/ {
13720 0 : __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
13721 0 : (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
13722 : }
13723 0 : __pyx_L19:;
13724 :
13725 : /* "View.MemoryView":880
13726 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13727 : *
13728 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13729 : * if not is_slice:
13730 : * if new_ndim == 0:
13731 : */
13732 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
13733 0 : if (__pyx_t_2) {
13734 :
13735 : /* "View.MemoryView":881
13736 : *
13737 : * if suboffset >= 0:
13738 : * if not is_slice: # <<<<<<<<<<<<<<
13739 : * if new_ndim == 0:
13740 : * dst.data = (<char **> dst.data)[0] + suboffset
13741 : */
13742 0 : __pyx_t_2 = (!__pyx_v_is_slice);
13743 0 : if (__pyx_t_2) {
13744 :
13745 : /* "View.MemoryView":882
13746 : * if suboffset >= 0:
13747 : * if not is_slice:
13748 : * if new_ndim == 0: # <<<<<<<<<<<<<<
13749 : * dst.data = (<char **> dst.data)[0] + suboffset
13750 : * else:
13751 : */
13752 0 : __pyx_t_2 = (__pyx_v_new_ndim == 0);
13753 0 : if (__pyx_t_2) {
13754 :
13755 : /* "View.MemoryView":883
13756 : * if not is_slice:
13757 : * if new_ndim == 0:
13758 : * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
13759 : * else:
13760 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
13761 : */
13762 0 : __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
13763 :
13764 : /* "View.MemoryView":882
13765 : * if suboffset >= 0:
13766 : * if not is_slice:
13767 : * if new_ndim == 0: # <<<<<<<<<<<<<<
13768 : * dst.data = (<char **> dst.data)[0] + suboffset
13769 : * else:
13770 : */
13771 0 : goto __pyx_L22;
13772 : }
13773 :
13774 : /* "View.MemoryView":885
13775 : * dst.data = (<char **> dst.data)[0] + suboffset
13776 : * else:
13777 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
13778 : * "must be indexed and not sliced", dim)
13779 : * else:
13780 : */
13781 : /*else*/ {
13782 :
13783 : /* "View.MemoryView":886
13784 : * else:
13785 : * _err_dim(PyExc_IndexError, "All dimensions preceding dimension %d "
13786 : * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
13787 : * else:
13788 : * suboffset_dim[0] = new_ndim
13789 : */
13790 0 : __pyx_t_3 = __pyx_memoryview_err_dim(PyExc_IndexError, __pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 885, __pyx_L1_error)
13791 : }
13792 0 : __pyx_L22:;
13793 :
13794 : /* "View.MemoryView":881
13795 : *
13796 : * if suboffset >= 0:
13797 : * if not is_slice: # <<<<<<<<<<<<<<
13798 : * if new_ndim == 0:
13799 : * dst.data = (<char **> dst.data)[0] + suboffset
13800 : */
13801 0 : goto __pyx_L21;
13802 : }
13803 :
13804 : /* "View.MemoryView":888
13805 : * "must be indexed and not sliced", dim)
13806 : * else:
13807 : * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
13808 : *
13809 : * return 0
13810 : */
13811 : /*else*/ {
13812 0 : (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
13813 : }
13814 0 : __pyx_L21:;
13815 :
13816 : /* "View.MemoryView":880
13817 : * dst.suboffsets[suboffset_dim[0]] += start * stride
13818 : *
13819 : * if suboffset >= 0: # <<<<<<<<<<<<<<
13820 : * if not is_slice:
13821 : * if new_ndim == 0:
13822 : */
13823 : }
13824 :
13825 : /* "View.MemoryView":890
13826 : * suboffset_dim[0] = new_ndim
13827 : *
13828 : * return 0 # <<<<<<<<<<<<<<
13829 : *
13830 : *
13831 : */
13832 0 : __pyx_r = 0;
13833 0 : goto __pyx_L0;
13834 :
13835 : /* "View.MemoryView":793
13836 : *
13837 : * @cname('__pyx_memoryview_slice_memviewslice')
13838 : * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
13839 : * __Pyx_memviewslice *dst,
13840 : * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
13841 : */
13842 :
13843 : /* function exit code */
13844 0 : __pyx_L1_error:;
13845 : #ifdef WITH_THREAD
13846 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
13847 : #endif
13848 0 : __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
13849 0 : __pyx_r = -1;
13850 : #ifdef WITH_THREAD
13851 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
13852 : #endif
13853 0 : __pyx_L0:;
13854 0 : return __pyx_r;
13855 : }
13856 :
13857 : /* "View.MemoryView":896
13858 : *
13859 : * @cname('__pyx_pybuffer_index')
13860 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
13861 : * Py_ssize_t dim) except NULL:
13862 : * cdef Py_ssize_t shape, stride, suboffset = -1
13863 : */
13864 :
13865 0 : static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
13866 0 : Py_ssize_t __pyx_v_shape;
13867 0 : Py_ssize_t __pyx_v_stride;
13868 0 : Py_ssize_t __pyx_v_suboffset;
13869 0 : Py_ssize_t __pyx_v_itemsize;
13870 0 : char *__pyx_v_resultp;
13871 0 : char *__pyx_r;
13872 : __Pyx_RefNannyDeclarations
13873 0 : Py_ssize_t __pyx_t_1;
13874 0 : int __pyx_t_2;
13875 0 : PyObject *__pyx_t_3 = NULL;
13876 0 : Py_UCS4 __pyx_t_4;
13877 0 : PyObject *__pyx_t_5 = NULL;
13878 0 : int __pyx_lineno = 0;
13879 0 : const char *__pyx_filename = NULL;
13880 0 : int __pyx_clineno = 0;
13881 0 : __Pyx_RefNannySetupContext("pybuffer_index", 1);
13882 :
13883 : /* "View.MemoryView":898
13884 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
13885 : * Py_ssize_t dim) except NULL:
13886 : * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
13887 : * cdef Py_ssize_t itemsize = view.itemsize
13888 : * cdef char *resultp
13889 : */
13890 0 : __pyx_v_suboffset = -1L;
13891 :
13892 : /* "View.MemoryView":899
13893 : * Py_ssize_t dim) except NULL:
13894 : * cdef Py_ssize_t shape, stride, suboffset = -1
13895 : * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
13896 : * cdef char *resultp
13897 : *
13898 : */
13899 0 : __pyx_t_1 = __pyx_v_view->itemsize;
13900 0 : __pyx_v_itemsize = __pyx_t_1;
13901 :
13902 : /* "View.MemoryView":902
13903 : * cdef char *resultp
13904 : *
13905 : * if view.ndim == 0: # <<<<<<<<<<<<<<
13906 : * shape = view.len // itemsize
13907 : * stride = itemsize
13908 : */
13909 0 : __pyx_t_2 = (__pyx_v_view->ndim == 0);
13910 0 : if (__pyx_t_2) {
13911 :
13912 : /* "View.MemoryView":903
13913 : *
13914 : * if view.ndim == 0:
13915 : * shape = view.len // itemsize # <<<<<<<<<<<<<<
13916 : * stride = itemsize
13917 : * else:
13918 : */
13919 0 : if (unlikely(__pyx_v_itemsize == 0)) {
13920 0 : PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
13921 0 : __PYX_ERR(1, 903, __pyx_L1_error)
13922 : }
13923 0 : else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(__Pyx_UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
13924 0 : PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
13925 0 : __PYX_ERR(1, 903, __pyx_L1_error)
13926 : }
13927 0 : __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
13928 :
13929 : /* "View.MemoryView":904
13930 : * if view.ndim == 0:
13931 : * shape = view.len // itemsize
13932 : * stride = itemsize # <<<<<<<<<<<<<<
13933 : * else:
13934 : * shape = view.shape[dim]
13935 : */
13936 0 : __pyx_v_stride = __pyx_v_itemsize;
13937 :
13938 : /* "View.MemoryView":902
13939 : * cdef char *resultp
13940 : *
13941 : * if view.ndim == 0: # <<<<<<<<<<<<<<
13942 : * shape = view.len // itemsize
13943 : * stride = itemsize
13944 : */
13945 0 : goto __pyx_L3;
13946 : }
13947 :
13948 : /* "View.MemoryView":906
13949 : * stride = itemsize
13950 : * else:
13951 : * shape = view.shape[dim] # <<<<<<<<<<<<<<
13952 : * stride = view.strides[dim]
13953 : * if view.suboffsets != NULL:
13954 : */
13955 : /*else*/ {
13956 0 : __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
13957 :
13958 : /* "View.MemoryView":907
13959 : * else:
13960 : * shape = view.shape[dim]
13961 : * stride = view.strides[dim] # <<<<<<<<<<<<<<
13962 : * if view.suboffsets != NULL:
13963 : * suboffset = view.suboffsets[dim]
13964 : */
13965 0 : __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
13966 :
13967 : /* "View.MemoryView":908
13968 : * shape = view.shape[dim]
13969 : * stride = view.strides[dim]
13970 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
13971 : * suboffset = view.suboffsets[dim]
13972 : *
13973 : */
13974 0 : __pyx_t_2 = (__pyx_v_view->suboffsets != NULL);
13975 0 : if (__pyx_t_2) {
13976 :
13977 : /* "View.MemoryView":909
13978 : * stride = view.strides[dim]
13979 : * if view.suboffsets != NULL:
13980 : * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
13981 : *
13982 : * if index < 0:
13983 : */
13984 0 : __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
13985 :
13986 : /* "View.MemoryView":908
13987 : * shape = view.shape[dim]
13988 : * stride = view.strides[dim]
13989 : * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
13990 : * suboffset = view.suboffsets[dim]
13991 : *
13992 : */
13993 : }
13994 : }
13995 0 : __pyx_L3:;
13996 :
13997 : /* "View.MemoryView":911
13998 : * suboffset = view.suboffsets[dim]
13999 : *
14000 : * if index < 0: # <<<<<<<<<<<<<<
14001 : * index += view.shape[dim]
14002 : * if index < 0:
14003 : */
14004 0 : __pyx_t_2 = (__pyx_v_index < 0);
14005 0 : if (__pyx_t_2) {
14006 :
14007 : /* "View.MemoryView":912
14008 : *
14009 : * if index < 0:
14010 : * index += view.shape[dim] # <<<<<<<<<<<<<<
14011 : * if index < 0:
14012 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14013 : */
14014 0 : __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
14015 :
14016 : /* "View.MemoryView":913
14017 : * if index < 0:
14018 : * index += view.shape[dim]
14019 : * if index < 0: # <<<<<<<<<<<<<<
14020 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14021 : *
14022 : */
14023 0 : __pyx_t_2 = (__pyx_v_index < 0);
14024 0 : if (unlikely(__pyx_t_2)) {
14025 :
14026 : /* "View.MemoryView":914
14027 : * index += view.shape[dim]
14028 : * if index < 0:
14029 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14030 : *
14031 : * if index >= shape:
14032 : */
14033 0 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
14034 0 : __Pyx_GOTREF(__pyx_t_3);
14035 0 : __pyx_t_1 = 0;
14036 0 : __pyx_t_4 = 127;
14037 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14038 0 : __pyx_t_1 += 37;
14039 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14040 0 : PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14041 0 : __pyx_t_5 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14042 0 : __Pyx_GOTREF(__pyx_t_5);
14043 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
14044 0 : __Pyx_GIVEREF(__pyx_t_5);
14045 0 : PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
14046 0 : __pyx_t_5 = 0;
14047 0 : __Pyx_INCREF(__pyx_kp_u__7);
14048 0 : __pyx_t_1 += 1;
14049 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14050 0 : PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__7);
14051 0 : __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 914, __pyx_L1_error)
14052 0 : __Pyx_GOTREF(__pyx_t_5);
14053 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14054 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_5, 0, 0);
14055 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14056 0 : __PYX_ERR(1, 914, __pyx_L1_error)
14057 :
14058 : /* "View.MemoryView":913
14059 : * if index < 0:
14060 : * index += view.shape[dim]
14061 : * if index < 0: # <<<<<<<<<<<<<<
14062 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14063 : *
14064 : */
14065 : }
14066 :
14067 : /* "View.MemoryView":911
14068 : * suboffset = view.suboffsets[dim]
14069 : *
14070 : * if index < 0: # <<<<<<<<<<<<<<
14071 : * index += view.shape[dim]
14072 : * if index < 0:
14073 : */
14074 : }
14075 :
14076 : /* "View.MemoryView":916
14077 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14078 : *
14079 : * if index >= shape: # <<<<<<<<<<<<<<
14080 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14081 : *
14082 : */
14083 0 : __pyx_t_2 = (__pyx_v_index >= __pyx_v_shape);
14084 0 : if (unlikely(__pyx_t_2)) {
14085 :
14086 : /* "View.MemoryView":917
14087 : *
14088 : * if index >= shape:
14089 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})" # <<<<<<<<<<<<<<
14090 : *
14091 : * resultp = bufp + index * stride
14092 : */
14093 0 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 917, __pyx_L1_error)
14094 0 : __Pyx_GOTREF(__pyx_t_5);
14095 0 : __pyx_t_1 = 0;
14096 0 : __pyx_t_4 = 127;
14097 0 : __Pyx_INCREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14098 0 : __pyx_t_1 += 37;
14099 0 : __Pyx_GIVEREF(__pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14100 0 : PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Out_of_bounds_on_buffer_access_a);
14101 0 : __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_dim, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14102 0 : __Pyx_GOTREF(__pyx_t_3);
14103 0 : __pyx_t_1 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
14104 0 : __Pyx_GIVEREF(__pyx_t_3);
14105 0 : PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
14106 0 : __pyx_t_3 = 0;
14107 0 : __Pyx_INCREF(__pyx_kp_u__7);
14108 0 : __pyx_t_1 += 1;
14109 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
14110 0 : PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__7);
14111 0 : __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __pyx_L1_error)
14112 0 : __Pyx_GOTREF(__pyx_t_3);
14113 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14114 0 : __Pyx_Raise(__pyx_builtin_IndexError, __pyx_t_3, 0, 0);
14115 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14116 0 : __PYX_ERR(1, 917, __pyx_L1_error)
14117 :
14118 : /* "View.MemoryView":916
14119 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14120 : *
14121 : * if index >= shape: # <<<<<<<<<<<<<<
14122 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14123 : *
14124 : */
14125 : }
14126 :
14127 : /* "View.MemoryView":919
14128 : * raise IndexError, f"Out of bounds on buffer access (axis {dim})"
14129 : *
14130 : * resultp = bufp + index * stride # <<<<<<<<<<<<<<
14131 : * if suboffset >= 0:
14132 : * resultp = (<char **> resultp)[0] + suboffset
14133 : */
14134 0 : __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
14135 :
14136 : /* "View.MemoryView":920
14137 : *
14138 : * resultp = bufp + index * stride
14139 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14140 : * resultp = (<char **> resultp)[0] + suboffset
14141 : *
14142 : */
14143 0 : __pyx_t_2 = (__pyx_v_suboffset >= 0);
14144 0 : if (__pyx_t_2) {
14145 :
14146 : /* "View.MemoryView":921
14147 : * resultp = bufp + index * stride
14148 : * if suboffset >= 0:
14149 : * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
14150 : *
14151 : * return resultp
14152 : */
14153 0 : __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
14154 :
14155 : /* "View.MemoryView":920
14156 : *
14157 : * resultp = bufp + index * stride
14158 : * if suboffset >= 0: # <<<<<<<<<<<<<<
14159 : * resultp = (<char **> resultp)[0] + suboffset
14160 : *
14161 : */
14162 : }
14163 :
14164 : /* "View.MemoryView":923
14165 : * resultp = (<char **> resultp)[0] + suboffset
14166 : *
14167 : * return resultp # <<<<<<<<<<<<<<
14168 : *
14169 : *
14170 : */
14171 0 : __pyx_r = __pyx_v_resultp;
14172 0 : goto __pyx_L0;
14173 :
14174 : /* "View.MemoryView":896
14175 : *
14176 : * @cname('__pyx_pybuffer_index')
14177 : * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
14178 : * Py_ssize_t dim) except NULL:
14179 : * cdef Py_ssize_t shape, stride, suboffset = -1
14180 : */
14181 :
14182 : /* function exit code */
14183 0 : __pyx_L1_error:;
14184 0 : __Pyx_XDECREF(__pyx_t_3);
14185 0 : __Pyx_XDECREF(__pyx_t_5);
14186 0 : __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
14187 0 : __pyx_r = NULL;
14188 0 : __pyx_L0:;
14189 0 : __Pyx_RefNannyFinishContext();
14190 0 : return __pyx_r;
14191 : }
14192 :
14193 : /* "View.MemoryView":929
14194 : *
14195 : * @cname('__pyx_memslice_transpose')
14196 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14197 : * cdef int ndim = memslice.memview.view.ndim
14198 : *
14199 : */
14200 :
14201 0 : static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
14202 0 : int __pyx_v_ndim;
14203 0 : Py_ssize_t *__pyx_v_shape;
14204 0 : Py_ssize_t *__pyx_v_strides;
14205 0 : int __pyx_v_i;
14206 0 : int __pyx_v_j;
14207 0 : int __pyx_r;
14208 0 : int __pyx_t_1;
14209 0 : Py_ssize_t *__pyx_t_2;
14210 0 : long __pyx_t_3;
14211 0 : long __pyx_t_4;
14212 0 : Py_ssize_t __pyx_t_5;
14213 0 : Py_ssize_t __pyx_t_6;
14214 0 : int __pyx_t_7;
14215 0 : int __pyx_t_8;
14216 0 : int __pyx_t_9;
14217 0 : int __pyx_lineno = 0;
14218 0 : const char *__pyx_filename = NULL;
14219 0 : int __pyx_clineno = 0;
14220 : #ifdef WITH_THREAD
14221 0 : PyGILState_STATE __pyx_gilstate_save;
14222 : #endif
14223 :
14224 : /* "View.MemoryView":930
14225 : * @cname('__pyx_memslice_transpose')
14226 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil:
14227 : * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
14228 : *
14229 : * cdef Py_ssize_t *shape = memslice.shape
14230 : */
14231 0 : __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
14232 0 : __pyx_v_ndim = __pyx_t_1;
14233 :
14234 : /* "View.MemoryView":932
14235 : * cdef int ndim = memslice.memview.view.ndim
14236 : *
14237 : * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
14238 : * cdef Py_ssize_t *strides = memslice.strides
14239 : *
14240 : */
14241 0 : __pyx_t_2 = __pyx_v_memslice->shape;
14242 0 : __pyx_v_shape = __pyx_t_2;
14243 :
14244 : /* "View.MemoryView":933
14245 : *
14246 : * cdef Py_ssize_t *shape = memslice.shape
14247 : * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
14248 : *
14249 : *
14250 : */
14251 0 : __pyx_t_2 = __pyx_v_memslice->strides;
14252 0 : __pyx_v_strides = __pyx_t_2;
14253 :
14254 : /* "View.MemoryView":937
14255 : *
14256 : * cdef int i, j
14257 : * for i in range(ndim // 2): # <<<<<<<<<<<<<<
14258 : * j = ndim - 1 - i
14259 : * strides[i], strides[j] = strides[j], strides[i]
14260 : */
14261 0 : __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
14262 0 : __pyx_t_4 = __pyx_t_3;
14263 0 : for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
14264 0 : __pyx_v_i = __pyx_t_1;
14265 :
14266 : /* "View.MemoryView":938
14267 : * cdef int i, j
14268 : * for i in range(ndim // 2):
14269 : * j = ndim - 1 - i # <<<<<<<<<<<<<<
14270 : * strides[i], strides[j] = strides[j], strides[i]
14271 : * shape[i], shape[j] = shape[j], shape[i]
14272 : */
14273 0 : __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
14274 :
14275 : /* "View.MemoryView":939
14276 : * for i in range(ndim // 2):
14277 : * j = ndim - 1 - i
14278 : * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
14279 : * shape[i], shape[j] = shape[j], shape[i]
14280 : *
14281 : */
14282 0 : __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
14283 0 : __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
14284 0 : (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
14285 0 : (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
14286 :
14287 : /* "View.MemoryView":940
14288 : * j = ndim - 1 - i
14289 : * strides[i], strides[j] = strides[j], strides[i]
14290 : * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
14291 : *
14292 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14293 : */
14294 0 : __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
14295 0 : __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
14296 0 : (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
14297 0 : (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
14298 :
14299 : /* "View.MemoryView":942
14300 : * shape[i], shape[j] = shape[j], shape[i]
14301 : *
14302 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
14303 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14304 : *
14305 : */
14306 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0);
14307 0 : if (!__pyx_t_8) {
14308 0 : } else {
14309 0 : __pyx_t_7 = __pyx_t_8;
14310 0 : goto __pyx_L6_bool_binop_done;
14311 : }
14312 0 : __pyx_t_8 = ((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0);
14313 0 : __pyx_t_7 = __pyx_t_8;
14314 0 : __pyx_L6_bool_binop_done:;
14315 0 : if (__pyx_t_7) {
14316 :
14317 : /* "View.MemoryView":943
14318 : *
14319 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
14320 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
14321 : *
14322 : * return 0
14323 : */
14324 0 : __pyx_t_9 = __pyx_memoryview_err(PyExc_ValueError, __pyx_kp_s_Cannot_transpose_memoryview_with); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 943, __pyx_L1_error)
14325 :
14326 : /* "View.MemoryView":942
14327 : * shape[i], shape[j] = shape[j], shape[i]
14328 : *
14329 : * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
14330 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14331 : *
14332 : */
14333 : }
14334 : }
14335 :
14336 : /* "View.MemoryView":945
14337 : * _err(PyExc_ValueError, "Cannot transpose memoryview with indirect dimensions")
14338 : *
14339 : * return 0 # <<<<<<<<<<<<<<
14340 : *
14341 : *
14342 : */
14343 0 : __pyx_r = 0;
14344 0 : goto __pyx_L0;
14345 :
14346 : /* "View.MemoryView":929
14347 : *
14348 : * @cname('__pyx_memslice_transpose')
14349 : * cdef int transpose_memslice(__Pyx_memviewslice *memslice) except -1 nogil: # <<<<<<<<<<<<<<
14350 : * cdef int ndim = memslice.memview.view.ndim
14351 : *
14352 : */
14353 :
14354 : /* function exit code */
14355 0 : __pyx_L1_error:;
14356 : #ifdef WITH_THREAD
14357 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
14358 : #endif
14359 0 : __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
14360 0 : __pyx_r = -1;
14361 : #ifdef WITH_THREAD
14362 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
14363 : #endif
14364 0 : __pyx_L0:;
14365 0 : return __pyx_r;
14366 : }
14367 :
14368 : /* "View.MemoryView":963
14369 : * cdef int (*to_dtype_func)(char *, object) except 0
14370 : *
14371 : * def __dealloc__(self): # <<<<<<<<<<<<<<
14372 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14373 : *
14374 : */
14375 :
14376 : /* Python wrapper */
14377 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
14378 430 : static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
14379 430 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14380 : __Pyx_RefNannyDeclarations
14381 430 : __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
14382 430 : __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
14383 860 : __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14384 :
14385 : /* function exit code */
14386 430 : __Pyx_RefNannyFinishContext();
14387 : }
14388 :
14389 430 : static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14390 :
14391 : /* "View.MemoryView":964
14392 : *
14393 : * def __dealloc__(self):
14394 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
14395 : *
14396 : * cdef convert_item_to_object(self, char *itemp):
14397 : */
14398 430 : __PYX_XCLEAR_MEMVIEW((&__pyx_v_self->from_slice), 1);
14399 :
14400 : /* "View.MemoryView":963
14401 : * cdef int (*to_dtype_func)(char *, object) except 0
14402 : *
14403 : * def __dealloc__(self): # <<<<<<<<<<<<<<
14404 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14405 : *
14406 : */
14407 :
14408 : /* function exit code */
14409 : }
14410 :
14411 : /* "View.MemoryView":966
14412 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14413 : *
14414 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14415 : * if self.to_object_func != NULL:
14416 : * return self.to_object_func(itemp)
14417 : */
14418 :
14419 0 : static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
14420 0 : PyObject *__pyx_r = NULL;
14421 : __Pyx_RefNannyDeclarations
14422 0 : int __pyx_t_1;
14423 0 : PyObject *__pyx_t_2 = NULL;
14424 0 : int __pyx_lineno = 0;
14425 0 : const char *__pyx_filename = NULL;
14426 0 : int __pyx_clineno = 0;
14427 0 : __Pyx_RefNannySetupContext("convert_item_to_object", 1);
14428 :
14429 : /* "View.MemoryView":967
14430 : *
14431 : * cdef convert_item_to_object(self, char *itemp):
14432 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14433 : * return self.to_object_func(itemp)
14434 : * else:
14435 : */
14436 0 : __pyx_t_1 = (__pyx_v_self->to_object_func != NULL);
14437 0 : if (__pyx_t_1) {
14438 :
14439 : /* "View.MemoryView":968
14440 : * cdef convert_item_to_object(self, char *itemp):
14441 : * if self.to_object_func != NULL:
14442 : * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
14443 : * else:
14444 : * return memoryview.convert_item_to_object(self, itemp)
14445 : */
14446 0 : __Pyx_XDECREF(__pyx_r);
14447 0 : __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
14448 0 : __Pyx_GOTREF(__pyx_t_2);
14449 0 : __pyx_r = __pyx_t_2;
14450 0 : __pyx_t_2 = 0;
14451 0 : goto __pyx_L0;
14452 :
14453 : /* "View.MemoryView":967
14454 : *
14455 : * cdef convert_item_to_object(self, char *itemp):
14456 : * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
14457 : * return self.to_object_func(itemp)
14458 : * else:
14459 : */
14460 : }
14461 :
14462 : /* "View.MemoryView":970
14463 : * return self.to_object_func(itemp)
14464 : * else:
14465 : * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
14466 : *
14467 : * cdef assign_item_from_object(self, char *itemp, object value):
14468 : */
14469 : /*else*/ {
14470 0 : __Pyx_XDECREF(__pyx_r);
14471 0 : __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 970, __pyx_L1_error)
14472 0 : __Pyx_GOTREF(__pyx_t_2);
14473 0 : __pyx_r = __pyx_t_2;
14474 0 : __pyx_t_2 = 0;
14475 0 : goto __pyx_L0;
14476 : }
14477 :
14478 : /* "View.MemoryView":966
14479 : * __PYX_XCLEAR_MEMVIEW(&self.from_slice, 1)
14480 : *
14481 : * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
14482 : * if self.to_object_func != NULL:
14483 : * return self.to_object_func(itemp)
14484 : */
14485 :
14486 : /* function exit code */
14487 0 : __pyx_L1_error:;
14488 0 : __Pyx_XDECREF(__pyx_t_2);
14489 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14490 0 : __pyx_r = 0;
14491 0 : __pyx_L0:;
14492 0 : __Pyx_XGIVEREF(__pyx_r);
14493 0 : __Pyx_RefNannyFinishContext();
14494 0 : return __pyx_r;
14495 : }
14496 :
14497 : /* "View.MemoryView":972
14498 : * return memoryview.convert_item_to_object(self, itemp)
14499 : *
14500 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14501 : * if self.to_dtype_func != NULL:
14502 : * self.to_dtype_func(itemp, value)
14503 : */
14504 :
14505 0 : static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
14506 0 : PyObject *__pyx_r = NULL;
14507 : __Pyx_RefNannyDeclarations
14508 0 : int __pyx_t_1;
14509 0 : int __pyx_t_2;
14510 0 : PyObject *__pyx_t_3 = NULL;
14511 0 : int __pyx_lineno = 0;
14512 0 : const char *__pyx_filename = NULL;
14513 0 : int __pyx_clineno = 0;
14514 0 : __Pyx_RefNannySetupContext("assign_item_from_object", 1);
14515 :
14516 : /* "View.MemoryView":973
14517 : *
14518 : * cdef assign_item_from_object(self, char *itemp, object value):
14519 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14520 : * self.to_dtype_func(itemp, value)
14521 : * else:
14522 : */
14523 0 : __pyx_t_1 = (__pyx_v_self->to_dtype_func != NULL);
14524 0 : if (__pyx_t_1) {
14525 :
14526 : /* "View.MemoryView":974
14527 : * cdef assign_item_from_object(self, char *itemp, object value):
14528 : * if self.to_dtype_func != NULL:
14529 : * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
14530 : * else:
14531 : * memoryview.assign_item_from_object(self, itemp, value)
14532 : */
14533 0 : __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 974, __pyx_L1_error)
14534 :
14535 : /* "View.MemoryView":973
14536 : *
14537 : * cdef assign_item_from_object(self, char *itemp, object value):
14538 : * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
14539 : * self.to_dtype_func(itemp, value)
14540 : * else:
14541 : */
14542 0 : goto __pyx_L3;
14543 : }
14544 :
14545 : /* "View.MemoryView":976
14546 : * self.to_dtype_func(itemp, value)
14547 : * else:
14548 : * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
14549 : *
14550 : * cdef _get_base(self):
14551 : */
14552 : /*else*/ {
14553 0 : __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 976, __pyx_L1_error)
14554 0 : __Pyx_GOTREF(__pyx_t_3);
14555 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14556 : }
14557 0 : __pyx_L3:;
14558 :
14559 : /* "View.MemoryView":972
14560 : * return memoryview.convert_item_to_object(self, itemp)
14561 : *
14562 : * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
14563 : * if self.to_dtype_func != NULL:
14564 : * self.to_dtype_func(itemp, value)
14565 : */
14566 :
14567 : /* function exit code */
14568 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14569 0 : goto __pyx_L0;
14570 0 : __pyx_L1_error:;
14571 0 : __Pyx_XDECREF(__pyx_t_3);
14572 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
14573 0 : __pyx_r = 0;
14574 0 : __pyx_L0:;
14575 0 : __Pyx_XGIVEREF(__pyx_r);
14576 0 : __Pyx_RefNannyFinishContext();
14577 0 : return __pyx_r;
14578 : }
14579 :
14580 : /* "View.MemoryView":978
14581 : * memoryview.assign_item_from_object(self, itemp, value)
14582 : *
14583 : * cdef _get_base(self): # <<<<<<<<<<<<<<
14584 : * return self.from_object
14585 : *
14586 : */
14587 :
14588 426 : static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14589 426 : PyObject *__pyx_r = NULL;
14590 : __Pyx_RefNannyDeclarations
14591 426 : __Pyx_RefNannySetupContext("_get_base", 1);
14592 :
14593 : /* "View.MemoryView":979
14594 : *
14595 : * cdef _get_base(self):
14596 : * return self.from_object # <<<<<<<<<<<<<<
14597 : *
14598 : *
14599 : */
14600 426 : __Pyx_XDECREF(__pyx_r);
14601 426 : __Pyx_INCREF(__pyx_v_self->from_object);
14602 426 : __pyx_r = __pyx_v_self->from_object;
14603 426 : goto __pyx_L0;
14604 :
14605 : /* "View.MemoryView":978
14606 : * memoryview.assign_item_from_object(self, itemp, value)
14607 : *
14608 : * cdef _get_base(self): # <<<<<<<<<<<<<<
14609 : * return self.from_object
14610 : *
14611 : */
14612 :
14613 : /* function exit code */
14614 426 : __pyx_L0:;
14615 426 : __Pyx_XGIVEREF(__pyx_r);
14616 426 : __Pyx_RefNannyFinishContext();
14617 426 : return __pyx_r;
14618 : }
14619 :
14620 : /* "(tree fragment)":1
14621 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14622 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14623 : * def __setstate_cython__(self, __pyx_state):
14624 : */
14625 :
14626 : /* Python wrapper */
14627 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14628 : #if CYTHON_METH_FASTCALL
14629 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14630 : #else
14631 : PyObject *__pyx_args, PyObject *__pyx_kwds
14632 : #endif
14633 : ); /*proto*/
14634 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self,
14635 : #if CYTHON_METH_FASTCALL
14636 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14637 : #else
14638 : PyObject *__pyx_args, PyObject *__pyx_kwds
14639 : #endif
14640 : ) {
14641 : #if !CYTHON_METH_FASTCALL
14642 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14643 : #endif
14644 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14645 0 : PyObject *__pyx_r = 0;
14646 : __Pyx_RefNannyDeclarations
14647 0 : __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14648 : #if !CYTHON_METH_FASTCALL
14649 : #if CYTHON_ASSUME_SAFE_MACROS
14650 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14651 : #else
14652 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14653 : #endif
14654 : #endif
14655 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14656 0 : if (unlikely(__pyx_nargs > 0)) {
14657 0 : __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
14658 0 : if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
14659 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
14660 :
14661 : /* function exit code */
14662 0 : __Pyx_RefNannyFinishContext();
14663 0 : return __pyx_r;
14664 : }
14665 :
14666 0 : static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
14667 0 : PyObject *__pyx_r = NULL;
14668 : __Pyx_RefNannyDeclarations
14669 0 : int __pyx_lineno = 0;
14670 0 : const char *__pyx_filename = NULL;
14671 0 : int __pyx_clineno = 0;
14672 0 : __Pyx_RefNannySetupContext("__reduce_cython__", 1);
14673 :
14674 : /* "(tree fragment)":2
14675 : * def __reduce_cython__(self):
14676 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14677 : * def __setstate_cython__(self, __pyx_state):
14678 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14679 : */
14680 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
14681 0 : __PYX_ERR(1, 2, __pyx_L1_error)
14682 :
14683 : /* "(tree fragment)":1
14684 : * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14685 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14686 : * def __setstate_cython__(self, __pyx_state):
14687 : */
14688 :
14689 : /* function exit code */
14690 0 : __pyx_L1_error:;
14691 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14692 0 : __pyx_r = NULL;
14693 0 : __Pyx_XGIVEREF(__pyx_r);
14694 0 : __Pyx_RefNannyFinishContext();
14695 0 : return __pyx_r;
14696 : }
14697 :
14698 : /* "(tree fragment)":3
14699 : * def __reduce_cython__(self):
14700 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14701 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14702 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14703 : */
14704 :
14705 : /* Python wrapper */
14706 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14707 : #if CYTHON_METH_FASTCALL
14708 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14709 : #else
14710 : PyObject *__pyx_args, PyObject *__pyx_kwds
14711 : #endif
14712 : ); /*proto*/
14713 0 : static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self,
14714 : #if CYTHON_METH_FASTCALL
14715 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
14716 : #else
14717 : PyObject *__pyx_args, PyObject *__pyx_kwds
14718 : #endif
14719 : ) {
14720 0 : CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
14721 : #if !CYTHON_METH_FASTCALL
14722 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
14723 : #endif
14724 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
14725 0 : PyObject* values[1] = {0};
14726 0 : int __pyx_lineno = 0;
14727 0 : const char *__pyx_filename = NULL;
14728 0 : int __pyx_clineno = 0;
14729 0 : PyObject *__pyx_r = 0;
14730 : __Pyx_RefNannyDeclarations
14731 0 : __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14732 : #if !CYTHON_METH_FASTCALL
14733 : #if CYTHON_ASSUME_SAFE_MACROS
14734 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
14735 : #else
14736 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
14737 : #endif
14738 : #endif
14739 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
14740 : {
14741 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
14742 0 : if (__pyx_kwds) {
14743 0 : Py_ssize_t kw_args;
14744 0 : switch (__pyx_nargs) {
14745 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
14746 0 : CYTHON_FALLTHROUGH;
14747 0 : case 0: break;
14748 0 : default: goto __pyx_L5_argtuple_error;
14749 : }
14750 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
14751 0 : switch (__pyx_nargs) {
14752 : case 0:
14753 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
14754 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
14755 0 : kw_args--;
14756 : }
14757 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
14758 0 : else goto __pyx_L5_argtuple_error;
14759 : }
14760 0 : if (unlikely(kw_args > 0)) {
14761 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
14762 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
14763 : }
14764 0 : } else if (unlikely(__pyx_nargs != 1)) {
14765 0 : goto __pyx_L5_argtuple_error;
14766 : } else {
14767 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
14768 : }
14769 0 : __pyx_v___pyx_state = values[0];
14770 : }
14771 0 : goto __pyx_L6_skip;
14772 0 : __pyx_L5_argtuple_error:;
14773 0 : __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
14774 0 : __pyx_L6_skip:;
14775 0 : goto __pyx_L4_argument_unpacking_done;
14776 0 : __pyx_L3_error:;
14777 : {
14778 0 : Py_ssize_t __pyx_temp;
14779 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14780 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
14781 : }
14782 : }
14783 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14784 0 : __Pyx_RefNannyFinishContext();
14785 0 : return NULL;
14786 0 : __pyx_L4_argument_unpacking_done:;
14787 0 : __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), __pyx_v___pyx_state);
14788 :
14789 : /* function exit code */
14790 : {
14791 0 : Py_ssize_t __pyx_temp;
14792 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
14793 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
14794 : }
14795 : }
14796 : __Pyx_RefNannyFinishContext();
14797 : return __pyx_r;
14798 : }
14799 :
14800 0 : static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14801 0 : PyObject *__pyx_r = NULL;
14802 : __Pyx_RefNannyDeclarations
14803 0 : int __pyx_lineno = 0;
14804 0 : const char *__pyx_filename = NULL;
14805 0 : int __pyx_clineno = 0;
14806 0 : __Pyx_RefNannySetupContext("__setstate_cython__", 1);
14807 :
14808 : /* "(tree fragment)":4
14809 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14810 : * def __setstate_cython__(self, __pyx_state):
14811 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" # <<<<<<<<<<<<<<
14812 : */
14813 0 : __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_no_default___reduce___due_to_non, 0, 0);
14814 0 : __PYX_ERR(1, 4, __pyx_L1_error)
14815 :
14816 : /* "(tree fragment)":3
14817 : * def __reduce_cython__(self):
14818 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14819 : * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14820 : * raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
14821 : */
14822 :
14823 : /* function exit code */
14824 0 : __pyx_L1_error:;
14825 0 : __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14826 0 : __pyx_r = NULL;
14827 0 : __Pyx_XGIVEREF(__pyx_r);
14828 0 : __Pyx_RefNannyFinishContext();
14829 0 : return __pyx_r;
14830 : }
14831 :
14832 : /* "View.MemoryView":999
14833 : *
14834 : * @cname('__pyx_memoryview_fromslice')
14835 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
14836 : * int ndim,
14837 : * object (*to_object_func)(char *),
14838 : */
14839 :
14840 430 : static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
14841 430 : struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
14842 430 : Py_ssize_t __pyx_v_suboffset;
14843 430 : PyObject *__pyx_v_length = NULL;
14844 430 : PyObject *__pyx_r = NULL;
14845 : __Pyx_RefNannyDeclarations
14846 430 : int __pyx_t_1;
14847 430 : PyObject *__pyx_t_2 = NULL;
14848 430 : PyObject *__pyx_t_3 = NULL;
14849 430 : __Pyx_TypeInfo *__pyx_t_4;
14850 430 : Py_buffer __pyx_t_5;
14851 430 : Py_ssize_t *__pyx_t_6;
14852 430 : Py_ssize_t *__pyx_t_7;
14853 430 : Py_ssize_t *__pyx_t_8;
14854 430 : Py_ssize_t __pyx_t_9;
14855 430 : int __pyx_lineno = 0;
14856 430 : const char *__pyx_filename = NULL;
14857 430 : int __pyx_clineno = 0;
14858 430 : __Pyx_RefNannySetupContext("memoryview_fromslice", 1);
14859 :
14860 : /* "View.MemoryView":1007
14861 : * cdef _memoryviewslice result
14862 : *
14863 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14864 : * return None
14865 : *
14866 : */
14867 430 : __pyx_t_1 = (((PyObject *)__pyx_v_memviewslice.memview) == Py_None);
14868 430 : if (__pyx_t_1) {
14869 :
14870 : /* "View.MemoryView":1008
14871 : *
14872 : * if <PyObject *> memviewslice.memview == Py_None:
14873 : * return None # <<<<<<<<<<<<<<
14874 : *
14875 : *
14876 : */
14877 0 : __Pyx_XDECREF(__pyx_r);
14878 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14879 0 : goto __pyx_L0;
14880 :
14881 : /* "View.MemoryView":1007
14882 : * cdef _memoryviewslice result
14883 : *
14884 : * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
14885 : * return None
14886 : *
14887 : */
14888 : }
14889 :
14890 : /* "View.MemoryView":1013
14891 : *
14892 : *
14893 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object) # <<<<<<<<<<<<<<
14894 : *
14895 : * result.from_slice = memviewslice
14896 : */
14897 430 : __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
14898 430 : __Pyx_GOTREF(__pyx_t_2);
14899 430 : __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
14900 430 : __Pyx_GOTREF(__pyx_t_3);
14901 430 : __Pyx_INCREF(Py_None);
14902 430 : __Pyx_GIVEREF(Py_None);
14903 430 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(1, 1013, __pyx_L1_error);
14904 430 : __Pyx_INCREF(__pyx_int_0);
14905 430 : __Pyx_GIVEREF(__pyx_int_0);
14906 430 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(1, 1013, __pyx_L1_error);
14907 430 : __Pyx_GIVEREF(__pyx_t_2);
14908 430 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error);
14909 430 : __pyx_t_2 = 0;
14910 430 : __pyx_t_2 = ((PyObject *)__pyx_tp_new__memoryviewslice(((PyTypeObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
14911 430 : __Pyx_GOTREF((PyObject *)__pyx_t_2);
14912 430 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14913 430 : __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
14914 430 : __pyx_t_2 = 0;
14915 :
14916 : /* "View.MemoryView":1015
14917 : * result = _memoryviewslice.__new__(_memoryviewslice, None, 0, dtype_is_object)
14918 : *
14919 : * result.from_slice = memviewslice # <<<<<<<<<<<<<<
14920 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
14921 : *
14922 : */
14923 430 : __pyx_v_result->from_slice = __pyx_v_memviewslice;
14924 :
14925 : /* "View.MemoryView":1016
14926 : *
14927 : * result.from_slice = memviewslice
14928 : * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
14929 : *
14930 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
14931 : */
14932 430 : __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
14933 :
14934 : /* "View.MemoryView":1018
14935 : * __PYX_INC_MEMVIEW(&memviewslice, 1)
14936 : *
14937 : * result.from_object = (<memoryview> memviewslice.memview)._get_base() # <<<<<<<<<<<<<<
14938 : * result.typeinfo = memviewslice.memview.typeinfo
14939 : *
14940 : */
14941 430 : __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->__pyx_vtab)->_get_base(((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
14942 430 : __Pyx_GOTREF(__pyx_t_2);
14943 430 : __Pyx_GIVEREF(__pyx_t_2);
14944 430 : __Pyx_GOTREF(__pyx_v_result->from_object);
14945 430 : __Pyx_DECREF(__pyx_v_result->from_object);
14946 430 : __pyx_v_result->from_object = __pyx_t_2;
14947 430 : __pyx_t_2 = 0;
14948 :
14949 : /* "View.MemoryView":1019
14950 : *
14951 : * result.from_object = (<memoryview> memviewslice.memview)._get_base()
14952 : * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
14953 : *
14954 : * result.view = memviewslice.memview.view
14955 : */
14956 430 : __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
14957 430 : __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
14958 :
14959 : /* "View.MemoryView":1021
14960 : * result.typeinfo = memviewslice.memview.typeinfo
14961 : *
14962 : * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
14963 : * result.view.buf = <void *> memviewslice.data
14964 : * result.view.ndim = ndim
14965 : */
14966 430 : __pyx_t_5 = __pyx_v_memviewslice.memview->view;
14967 430 : __pyx_v_result->__pyx_base.view = __pyx_t_5;
14968 :
14969 : /* "View.MemoryView":1022
14970 : *
14971 : * result.view = memviewslice.memview.view
14972 : * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
14973 : * result.view.ndim = ndim
14974 : * (<__pyx_buffer *> &result.view).obj = Py_None
14975 : */
14976 430 : __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
14977 :
14978 : /* "View.MemoryView":1023
14979 : * result.view = memviewslice.memview.view
14980 : * result.view.buf = <void *> memviewslice.data
14981 : * result.view.ndim = ndim # <<<<<<<<<<<<<<
14982 : * (<__pyx_buffer *> &result.view).obj = Py_None
14983 : * Py_INCREF(Py_None)
14984 : */
14985 430 : __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
14986 :
14987 : /* "View.MemoryView":1024
14988 : * result.view.buf = <void *> memviewslice.data
14989 : * result.view.ndim = ndim
14990 : * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
14991 : * Py_INCREF(Py_None)
14992 : *
14993 : */
14994 430 : ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
14995 :
14996 : /* "View.MemoryView":1025
14997 : * result.view.ndim = ndim
14998 : * (<__pyx_buffer *> &result.view).obj = Py_None
14999 : * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
15000 : *
15001 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15002 : */
15003 430 : Py_INCREF(Py_None);
15004 :
15005 : /* "View.MemoryView":1027
15006 : * Py_INCREF(Py_None)
15007 : *
15008 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15009 : * result.flags = PyBUF_RECORDS
15010 : * else:
15011 : */
15012 430 : __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
15013 430 : if (__pyx_t_1) {
15014 :
15015 : /* "View.MemoryView":1028
15016 : *
15017 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
15018 : * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
15019 : * else:
15020 : * result.flags = PyBUF_RECORDS_RO
15021 : */
15022 426 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
15023 :
15024 : /* "View.MemoryView":1027
15025 : * Py_INCREF(Py_None)
15026 : *
15027 : * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
15028 : * result.flags = PyBUF_RECORDS
15029 : * else:
15030 : */
15031 426 : goto __pyx_L4;
15032 : }
15033 :
15034 : /* "View.MemoryView":1030
15035 : * result.flags = PyBUF_RECORDS
15036 : * else:
15037 : * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
15038 : *
15039 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15040 : */
15041 : /*else*/ {
15042 4 : __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
15043 : }
15044 430 : __pyx_L4:;
15045 :
15046 : /* "View.MemoryView":1032
15047 : * result.flags = PyBUF_RECORDS_RO
15048 : *
15049 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
15050 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides
15051 : *
15052 : */
15053 430 : __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
15054 :
15055 : /* "View.MemoryView":1033
15056 : *
15057 : * result.view.shape = <Py_ssize_t *> result.from_slice.shape
15058 : * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
15059 : *
15060 : *
15061 : */
15062 430 : __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
15063 :
15064 : /* "View.MemoryView":1036
15065 : *
15066 : *
15067 : * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
15068 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15069 : * if suboffset >= 0:
15070 : */
15071 430 : __pyx_v_result->__pyx_base.view.suboffsets = NULL;
15072 :
15073 : /* "View.MemoryView":1037
15074 : *
15075 : * result.view.suboffsets = NULL
15076 : * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
15077 : * if suboffset >= 0:
15078 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15079 : */
15080 430 : __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
15081 860 : for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15082 430 : __pyx_t_6 = __pyx_t_8;
15083 430 : __pyx_v_suboffset = (__pyx_t_6[0]);
15084 :
15085 : /* "View.MemoryView":1038
15086 : * result.view.suboffsets = NULL
15087 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15088 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15089 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15090 : * break
15091 : */
15092 430 : __pyx_t_1 = (__pyx_v_suboffset >= 0);
15093 430 : if (__pyx_t_1) {
15094 :
15095 : /* "View.MemoryView":1039
15096 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15097 : * if suboffset >= 0:
15098 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
15099 : * break
15100 : *
15101 : */
15102 0 : __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
15103 :
15104 : /* "View.MemoryView":1040
15105 : * if suboffset >= 0:
15106 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15107 : * break # <<<<<<<<<<<<<<
15108 : *
15109 : * result.view.len = result.view.itemsize
15110 : */
15111 0 : goto __pyx_L6_break;
15112 :
15113 : /* "View.MemoryView":1038
15114 : * result.view.suboffsets = NULL
15115 : * for suboffset in result.from_slice.suboffsets[:ndim]:
15116 : * if suboffset >= 0: # <<<<<<<<<<<<<<
15117 : * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
15118 : * break
15119 : */
15120 : }
15121 : }
15122 430 : __pyx_L6_break:;
15123 :
15124 : /* "View.MemoryView":1042
15125 : * break
15126 : *
15127 : * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
15128 : * for length in result.view.shape[:ndim]:
15129 : * result.view.len *= length
15130 : */
15131 430 : __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
15132 430 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15133 :
15134 : /* "View.MemoryView":1043
15135 : *
15136 : * result.view.len = result.view.itemsize
15137 : * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
15138 : * result.view.len *= length
15139 : *
15140 : */
15141 430 : __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
15142 860 : for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
15143 430 : __pyx_t_6 = __pyx_t_8;
15144 430 : __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
15145 430 : __Pyx_GOTREF(__pyx_t_2);
15146 430 : __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
15147 430 : __pyx_t_2 = 0;
15148 :
15149 : /* "View.MemoryView":1044
15150 : * result.view.len = result.view.itemsize
15151 : * for length in result.view.shape[:ndim]:
15152 : * result.view.len *= length # <<<<<<<<<<<<<<
15153 : *
15154 : * result.to_object_func = to_object_func
15155 : */
15156 430 : __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
15157 430 : __Pyx_GOTREF(__pyx_t_2);
15158 430 : __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
15159 430 : __Pyx_GOTREF(__pyx_t_3);
15160 430 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15161 430 : __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
15162 430 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15163 430 : __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
15164 : }
15165 :
15166 : /* "View.MemoryView":1046
15167 : * result.view.len *= length
15168 : *
15169 : * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
15170 : * result.to_dtype_func = to_dtype_func
15171 : *
15172 : */
15173 430 : __pyx_v_result->to_object_func = __pyx_v_to_object_func;
15174 :
15175 : /* "View.MemoryView":1047
15176 : *
15177 : * result.to_object_func = to_object_func
15178 : * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
15179 : *
15180 : * return result
15181 : */
15182 430 : __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
15183 :
15184 : /* "View.MemoryView":1049
15185 : * result.to_dtype_func = to_dtype_func
15186 : *
15187 : * return result # <<<<<<<<<<<<<<
15188 : *
15189 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15190 : */
15191 430 : __Pyx_XDECREF(__pyx_r);
15192 430 : __Pyx_INCREF((PyObject *)__pyx_v_result);
15193 430 : __pyx_r = ((PyObject *)__pyx_v_result);
15194 430 : goto __pyx_L0;
15195 :
15196 : /* "View.MemoryView":999
15197 : *
15198 : * @cname('__pyx_memoryview_fromslice')
15199 : * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
15200 : * int ndim,
15201 : * object (*to_object_func)(char *),
15202 : */
15203 :
15204 : /* function exit code */
15205 0 : __pyx_L1_error:;
15206 0 : __Pyx_XDECREF(__pyx_t_2);
15207 0 : __Pyx_XDECREF(__pyx_t_3);
15208 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15209 0 : __pyx_r = 0;
15210 430 : __pyx_L0:;
15211 430 : __Pyx_XDECREF((PyObject *)__pyx_v_result);
15212 430 : __Pyx_XDECREF(__pyx_v_length);
15213 430 : __Pyx_XGIVEREF(__pyx_r);
15214 430 : __Pyx_RefNannyFinishContext();
15215 430 : return __pyx_r;
15216 : }
15217 :
15218 : /* "View.MemoryView":1052
15219 : *
15220 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15221 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15222 : * __Pyx_memviewslice *mslice) except NULL:
15223 : * cdef _memoryviewslice obj
15224 : */
15225 :
15226 0 : static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
15227 0 : struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
15228 0 : __Pyx_memviewslice *__pyx_r;
15229 : __Pyx_RefNannyDeclarations
15230 0 : int __pyx_t_1;
15231 0 : PyObject *__pyx_t_2 = NULL;
15232 0 : int __pyx_lineno = 0;
15233 0 : const char *__pyx_filename = NULL;
15234 0 : int __pyx_clineno = 0;
15235 0 : __Pyx_RefNannySetupContext("get_slice_from_memview", 1);
15236 :
15237 : /* "View.MemoryView":1055
15238 : * __Pyx_memviewslice *mslice) except NULL:
15239 : * cdef _memoryviewslice obj
15240 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15241 : * obj = memview
15242 : * return &obj.from_slice
15243 : */
15244 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15245 0 : if (__pyx_t_1) {
15246 :
15247 : /* "View.MemoryView":1056
15248 : * cdef _memoryviewslice obj
15249 : * if isinstance(memview, _memoryviewslice):
15250 : * obj = memview # <<<<<<<<<<<<<<
15251 : * return &obj.from_slice
15252 : * else:
15253 : */
15254 0 : if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
15255 0 : __pyx_t_2 = ((PyObject *)__pyx_v_memview);
15256 0 : __Pyx_INCREF(__pyx_t_2);
15257 0 : __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
15258 0 : __pyx_t_2 = 0;
15259 :
15260 : /* "View.MemoryView":1057
15261 : * if isinstance(memview, _memoryviewslice):
15262 : * obj = memview
15263 : * return &obj.from_slice # <<<<<<<<<<<<<<
15264 : * else:
15265 : * slice_copy(memview, mslice)
15266 : */
15267 0 : __pyx_r = (&__pyx_v_obj->from_slice);
15268 0 : goto __pyx_L0;
15269 :
15270 : /* "View.MemoryView":1055
15271 : * __Pyx_memviewslice *mslice) except NULL:
15272 : * cdef _memoryviewslice obj
15273 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15274 : * obj = memview
15275 : * return &obj.from_slice
15276 : */
15277 : }
15278 :
15279 : /* "View.MemoryView":1059
15280 : * return &obj.from_slice
15281 : * else:
15282 : * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
15283 : * return mslice
15284 : *
15285 : */
15286 : /*else*/ {
15287 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
15288 :
15289 : /* "View.MemoryView":1060
15290 : * else:
15291 : * slice_copy(memview, mslice)
15292 : * return mslice # <<<<<<<<<<<<<<
15293 : *
15294 : * @cname('__pyx_memoryview_slice_copy')
15295 : */
15296 0 : __pyx_r = __pyx_v_mslice;
15297 0 : goto __pyx_L0;
15298 : }
15299 :
15300 : /* "View.MemoryView":1052
15301 : *
15302 : * @cname('__pyx_memoryview_get_slice_from_memoryview')
15303 : * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
15304 : * __Pyx_memviewslice *mslice) except NULL:
15305 : * cdef _memoryviewslice obj
15306 : */
15307 :
15308 : /* function exit code */
15309 0 : __pyx_L1_error:;
15310 0 : __Pyx_XDECREF(__pyx_t_2);
15311 0 : __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
15312 0 : __pyx_r = NULL;
15313 0 : __pyx_L0:;
15314 0 : __Pyx_XDECREF((PyObject *)__pyx_v_obj);
15315 0 : __Pyx_RefNannyFinishContext();
15316 0 : return __pyx_r;
15317 : }
15318 :
15319 : /* "View.MemoryView":1063
15320 : *
15321 : * @cname('__pyx_memoryview_slice_copy')
15322 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
15323 : * cdef int dim
15324 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15325 : */
15326 :
15327 0 : static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
15328 0 : int __pyx_v_dim;
15329 0 : Py_ssize_t *__pyx_v_shape;
15330 0 : Py_ssize_t *__pyx_v_strides;
15331 0 : Py_ssize_t *__pyx_v_suboffsets;
15332 0 : Py_ssize_t *__pyx_t_1;
15333 0 : int __pyx_t_2;
15334 0 : int __pyx_t_3;
15335 0 : int __pyx_t_4;
15336 0 : Py_ssize_t __pyx_t_5;
15337 0 : int __pyx_t_6;
15338 :
15339 : /* "View.MemoryView":1067
15340 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15341 : *
15342 : * shape = memview.view.shape # <<<<<<<<<<<<<<
15343 : * strides = memview.view.strides
15344 : * suboffsets = memview.view.suboffsets
15345 : */
15346 0 : __pyx_t_1 = __pyx_v_memview->view.shape;
15347 0 : __pyx_v_shape = __pyx_t_1;
15348 :
15349 : /* "View.MemoryView":1068
15350 : *
15351 : * shape = memview.view.shape
15352 : * strides = memview.view.strides # <<<<<<<<<<<<<<
15353 : * suboffsets = memview.view.suboffsets
15354 : *
15355 : */
15356 0 : __pyx_t_1 = __pyx_v_memview->view.strides;
15357 0 : __pyx_v_strides = __pyx_t_1;
15358 :
15359 : /* "View.MemoryView":1069
15360 : * shape = memview.view.shape
15361 : * strides = memview.view.strides
15362 : * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
15363 : *
15364 : * dst.memview = <__pyx_memoryview *> memview
15365 : */
15366 0 : __pyx_t_1 = __pyx_v_memview->view.suboffsets;
15367 0 : __pyx_v_suboffsets = __pyx_t_1;
15368 :
15369 : /* "View.MemoryView":1071
15370 : * suboffsets = memview.view.suboffsets
15371 : *
15372 : * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
15373 : * dst.data = <char *> memview.view.buf
15374 : *
15375 : */
15376 0 : __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
15377 :
15378 : /* "View.MemoryView":1072
15379 : *
15380 : * dst.memview = <__pyx_memoryview *> memview
15381 : * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
15382 : *
15383 : * for dim in range(memview.view.ndim):
15384 : */
15385 0 : __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
15386 :
15387 : /* "View.MemoryView":1074
15388 : * dst.data = <char *> memview.view.buf
15389 : *
15390 : * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
15391 : * dst.shape[dim] = shape[dim]
15392 : * dst.strides[dim] = strides[dim]
15393 : */
15394 0 : __pyx_t_2 = __pyx_v_memview->view.ndim;
15395 0 : __pyx_t_3 = __pyx_t_2;
15396 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15397 0 : __pyx_v_dim = __pyx_t_4;
15398 :
15399 : /* "View.MemoryView":1075
15400 : *
15401 : * for dim in range(memview.view.ndim):
15402 : * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
15403 : * dst.strides[dim] = strides[dim]
15404 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15405 : */
15406 0 : (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
15407 :
15408 : /* "View.MemoryView":1076
15409 : * for dim in range(memview.view.ndim):
15410 : * dst.shape[dim] = shape[dim]
15411 : * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
15412 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
15413 : *
15414 : */
15415 0 : (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
15416 :
15417 : /* "View.MemoryView":1077
15418 : * dst.shape[dim] = shape[dim]
15419 : * dst.strides[dim] = strides[dim]
15420 : * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
15421 : *
15422 : * @cname('__pyx_memoryview_copy_object')
15423 : */
15424 0 : __pyx_t_6 = (__pyx_v_suboffsets != 0);
15425 0 : if (__pyx_t_6) {
15426 0 : __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
15427 : } else {
15428 : __pyx_t_5 = -1L;
15429 : }
15430 0 : (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
15431 : }
15432 :
15433 : /* "View.MemoryView":1063
15434 : *
15435 : * @cname('__pyx_memoryview_slice_copy')
15436 : * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst) noexcept: # <<<<<<<<<<<<<<
15437 : * cdef int dim
15438 : * cdef (Py_ssize_t*) shape, strides, suboffsets
15439 : */
15440 :
15441 : /* function exit code */
15442 0 : }
15443 :
15444 : /* "View.MemoryView":1080
15445 : *
15446 : * @cname('__pyx_memoryview_copy_object')
15447 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15448 : * "Create a new memoryview object"
15449 : * cdef __Pyx_memviewslice memviewslice
15450 : */
15451 :
15452 0 : static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
15453 0 : __Pyx_memviewslice __pyx_v_memviewslice;
15454 0 : PyObject *__pyx_r = NULL;
15455 : __Pyx_RefNannyDeclarations
15456 0 : PyObject *__pyx_t_1 = NULL;
15457 0 : int __pyx_lineno = 0;
15458 0 : const char *__pyx_filename = NULL;
15459 0 : int __pyx_clineno = 0;
15460 0 : __Pyx_RefNannySetupContext("memoryview_copy", 1);
15461 :
15462 : /* "View.MemoryView":1083
15463 : * "Create a new memoryview object"
15464 : * cdef __Pyx_memviewslice memviewslice
15465 : * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
15466 : * return memoryview_copy_from_slice(memview, &memviewslice)
15467 : *
15468 : */
15469 0 : __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
15470 :
15471 : /* "View.MemoryView":1084
15472 : * cdef __Pyx_memviewslice memviewslice
15473 : * slice_copy(memview, &memviewslice)
15474 : * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
15475 : *
15476 : * @cname('__pyx_memoryview_copy_object_from_slice')
15477 : */
15478 0 : __Pyx_XDECREF(__pyx_r);
15479 0 : __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
15480 0 : __Pyx_GOTREF(__pyx_t_1);
15481 0 : __pyx_r = __pyx_t_1;
15482 0 : __pyx_t_1 = 0;
15483 0 : goto __pyx_L0;
15484 :
15485 : /* "View.MemoryView":1080
15486 : *
15487 : * @cname('__pyx_memoryview_copy_object')
15488 : * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
15489 : * "Create a new memoryview object"
15490 : * cdef __Pyx_memviewslice memviewslice
15491 : */
15492 :
15493 : /* function exit code */
15494 0 : __pyx_L1_error:;
15495 0 : __Pyx_XDECREF(__pyx_t_1);
15496 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
15497 0 : __pyx_r = 0;
15498 0 : __pyx_L0:;
15499 0 : __Pyx_XGIVEREF(__pyx_r);
15500 0 : __Pyx_RefNannyFinishContext();
15501 0 : return __pyx_r;
15502 : }
15503 :
15504 : /* "View.MemoryView":1087
15505 : *
15506 : * @cname('__pyx_memoryview_copy_object_from_slice')
15507 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15508 : * """
15509 : * Create a new memoryview object from a given memoryview object and slice.
15510 : */
15511 :
15512 0 : static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
15513 0 : PyObject *(*__pyx_v_to_object_func)(char *);
15514 0 : int (*__pyx_v_to_dtype_func)(char *, PyObject *);
15515 0 : PyObject *__pyx_r = NULL;
15516 : __Pyx_RefNannyDeclarations
15517 0 : int __pyx_t_1;
15518 0 : PyObject *(*__pyx_t_2)(char *);
15519 0 : int (*__pyx_t_3)(char *, PyObject *);
15520 0 : PyObject *__pyx_t_4 = NULL;
15521 0 : int __pyx_lineno = 0;
15522 0 : const char *__pyx_filename = NULL;
15523 0 : int __pyx_clineno = 0;
15524 0 : __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 1);
15525 :
15526 : /* "View.MemoryView":1094
15527 : * cdef int (*to_dtype_func)(char *, object) except 0
15528 : *
15529 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15530 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15531 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15532 : */
15533 0 : __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15534 0 : if (__pyx_t_1) {
15535 :
15536 : /* "View.MemoryView":1095
15537 : *
15538 : * if isinstance(memview, _memoryviewslice):
15539 : * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
15540 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15541 : * else:
15542 : */
15543 0 : __pyx_t_2 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
15544 0 : __pyx_v_to_object_func = __pyx_t_2;
15545 :
15546 : /* "View.MemoryView":1096
15547 : * if isinstance(memview, _memoryviewslice):
15548 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15549 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
15550 : * else:
15551 : * to_object_func = NULL
15552 : */
15553 0 : __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
15554 0 : __pyx_v_to_dtype_func = __pyx_t_3;
15555 :
15556 : /* "View.MemoryView":1094
15557 : * cdef int (*to_dtype_func)(char *, object) except 0
15558 : *
15559 : * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15560 : * to_object_func = (<_memoryviewslice> memview).to_object_func
15561 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15562 : */
15563 0 : goto __pyx_L3;
15564 : }
15565 :
15566 : /* "View.MemoryView":1098
15567 : * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
15568 : * else:
15569 : * to_object_func = NULL # <<<<<<<<<<<<<<
15570 : * to_dtype_func = NULL
15571 : *
15572 : */
15573 : /*else*/ {
15574 : __pyx_v_to_object_func = NULL;
15575 :
15576 : /* "View.MemoryView":1099
15577 : * else:
15578 : * to_object_func = NULL
15579 : * to_dtype_func = NULL # <<<<<<<<<<<<<<
15580 : *
15581 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15582 : */
15583 : __pyx_v_to_dtype_func = NULL;
15584 : }
15585 0 : __pyx_L3:;
15586 :
15587 : /* "View.MemoryView":1101
15588 : * to_dtype_func = NULL
15589 : *
15590 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
15591 : * to_object_func, to_dtype_func,
15592 : * memview.dtype_is_object)
15593 : */
15594 0 : __Pyx_XDECREF(__pyx_r);
15595 :
15596 : /* "View.MemoryView":1103
15597 : * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
15598 : * to_object_func, to_dtype_func,
15599 : * memview.dtype_is_object) # <<<<<<<<<<<<<<
15600 : *
15601 : *
15602 : */
15603 0 : __pyx_t_4 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1101, __pyx_L1_error)
15604 0 : __Pyx_GOTREF(__pyx_t_4);
15605 0 : __pyx_r = __pyx_t_4;
15606 0 : __pyx_t_4 = 0;
15607 0 : goto __pyx_L0;
15608 :
15609 : /* "View.MemoryView":1087
15610 : *
15611 : * @cname('__pyx_memoryview_copy_object_from_slice')
15612 : * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
15613 : * """
15614 : * Create a new memoryview object from a given memoryview object and slice.
15615 : */
15616 :
15617 : /* function exit code */
15618 0 : __pyx_L1_error:;
15619 0 : __Pyx_XDECREF(__pyx_t_4);
15620 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15621 0 : __pyx_r = 0;
15622 0 : __pyx_L0:;
15623 0 : __Pyx_XGIVEREF(__pyx_r);
15624 0 : __Pyx_RefNannyFinishContext();
15625 0 : return __pyx_r;
15626 : }
15627 :
15628 : /* "View.MemoryView":1109
15629 : *
15630 : *
15631 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15632 : * return -arg if arg < 0 else arg
15633 : *
15634 : */
15635 :
15636 0 : static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
15637 0 : Py_ssize_t __pyx_r;
15638 0 : Py_ssize_t __pyx_t_1;
15639 0 : int __pyx_t_2;
15640 :
15641 : /* "View.MemoryView":1110
15642 : *
15643 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil:
15644 : * return -arg if arg < 0 else arg # <<<<<<<<<<<<<<
15645 : *
15646 : * @cname('__pyx_get_best_slice_order')
15647 : */
15648 0 : __pyx_t_2 = (__pyx_v_arg < 0);
15649 0 : if (__pyx_t_2) {
15650 : __pyx_t_1 = (-__pyx_v_arg);
15651 : } else {
15652 : __pyx_t_1 = __pyx_v_arg;
15653 : }
15654 0 : __pyx_r = __pyx_t_1;
15655 0 : goto __pyx_L0;
15656 :
15657 : /* "View.MemoryView":1109
15658 : *
15659 : *
15660 : * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) noexcept nogil: # <<<<<<<<<<<<<<
15661 : * return -arg if arg < 0 else arg
15662 : *
15663 : */
15664 :
15665 : /* function exit code */
15666 0 : __pyx_L0:;
15667 0 : return __pyx_r;
15668 : }
15669 :
15670 : /* "View.MemoryView":1113
15671 : *
15672 : * @cname('__pyx_get_best_slice_order')
15673 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
15674 : * """
15675 : * Figure out the best memory access order for a given slice.
15676 : */
15677 :
15678 0 : static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
15679 0 : int __pyx_v_i;
15680 0 : Py_ssize_t __pyx_v_c_stride;
15681 0 : Py_ssize_t __pyx_v_f_stride;
15682 0 : char __pyx_r;
15683 0 : int __pyx_t_1;
15684 0 : int __pyx_t_2;
15685 0 : int __pyx_t_3;
15686 0 : int __pyx_t_4;
15687 :
15688 : /* "View.MemoryView":1118
15689 : * """
15690 : * cdef int i
15691 : * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
15692 : * cdef Py_ssize_t f_stride = 0
15693 : *
15694 : */
15695 0 : __pyx_v_c_stride = 0;
15696 :
15697 : /* "View.MemoryView":1119
15698 : * cdef int i
15699 : * cdef Py_ssize_t c_stride = 0
15700 : * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
15701 : *
15702 : * for i in range(ndim - 1, -1, -1):
15703 : */
15704 0 : __pyx_v_f_stride = 0;
15705 :
15706 : /* "View.MemoryView":1121
15707 : * cdef Py_ssize_t f_stride = 0
15708 : *
15709 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
15710 : * if mslice.shape[i] > 1:
15711 : * c_stride = mslice.strides[i]
15712 : */
15713 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
15714 0 : __pyx_v_i = __pyx_t_1;
15715 :
15716 : /* "View.MemoryView":1122
15717 : *
15718 : * for i in range(ndim - 1, -1, -1):
15719 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15720 : * c_stride = mslice.strides[i]
15721 : * break
15722 : */
15723 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15724 0 : if (__pyx_t_2) {
15725 :
15726 : /* "View.MemoryView":1123
15727 : * for i in range(ndim - 1, -1, -1):
15728 : * if mslice.shape[i] > 1:
15729 : * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15730 : * break
15731 : *
15732 : */
15733 0 : __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15734 :
15735 : /* "View.MemoryView":1124
15736 : * if mslice.shape[i] > 1:
15737 : * c_stride = mslice.strides[i]
15738 : * break # <<<<<<<<<<<<<<
15739 : *
15740 : * for i in range(ndim):
15741 : */
15742 0 : goto __pyx_L4_break;
15743 :
15744 : /* "View.MemoryView":1122
15745 : *
15746 : * for i in range(ndim - 1, -1, -1):
15747 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15748 : * c_stride = mslice.strides[i]
15749 : * break
15750 : */
15751 : }
15752 : }
15753 0 : __pyx_L4_break:;
15754 :
15755 : /* "View.MemoryView":1126
15756 : * break
15757 : *
15758 : * for i in range(ndim): # <<<<<<<<<<<<<<
15759 : * if mslice.shape[i] > 1:
15760 : * f_stride = mslice.strides[i]
15761 : */
15762 0 : __pyx_t_1 = __pyx_v_ndim;
15763 0 : __pyx_t_3 = __pyx_t_1;
15764 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15765 0 : __pyx_v_i = __pyx_t_4;
15766 :
15767 : /* "View.MemoryView":1127
15768 : *
15769 : * for i in range(ndim):
15770 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15771 : * f_stride = mslice.strides[i]
15772 : * break
15773 : */
15774 0 : __pyx_t_2 = ((__pyx_v_mslice->shape[__pyx_v_i]) > 1);
15775 0 : if (__pyx_t_2) {
15776 :
15777 : /* "View.MemoryView":1128
15778 : * for i in range(ndim):
15779 : * if mslice.shape[i] > 1:
15780 : * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
15781 : * break
15782 : *
15783 : */
15784 0 : __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
15785 :
15786 : /* "View.MemoryView":1129
15787 : * if mslice.shape[i] > 1:
15788 : * f_stride = mslice.strides[i]
15789 : * break # <<<<<<<<<<<<<<
15790 : *
15791 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15792 : */
15793 0 : goto __pyx_L7_break;
15794 :
15795 : /* "View.MemoryView":1127
15796 : *
15797 : * for i in range(ndim):
15798 : * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
15799 : * f_stride = mslice.strides[i]
15800 : * break
15801 : */
15802 : }
15803 : }
15804 0 : __pyx_L7_break:;
15805 :
15806 : /* "View.MemoryView":1131
15807 : * break
15808 : *
15809 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15810 : * return 'C'
15811 : * else:
15812 : */
15813 0 : __pyx_t_2 = (abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride));
15814 0 : if (__pyx_t_2) {
15815 :
15816 : /* "View.MemoryView":1132
15817 : *
15818 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
15819 : * return 'C' # <<<<<<<<<<<<<<
15820 : * else:
15821 : * return 'F'
15822 : */
15823 0 : __pyx_r = 'C';
15824 0 : goto __pyx_L0;
15825 :
15826 : /* "View.MemoryView":1131
15827 : * break
15828 : *
15829 : * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
15830 : * return 'C'
15831 : * else:
15832 : */
15833 : }
15834 :
15835 : /* "View.MemoryView":1134
15836 : * return 'C'
15837 : * else:
15838 : * return 'F' # <<<<<<<<<<<<<<
15839 : *
15840 : * @cython.cdivision(True)
15841 : */
15842 : /*else*/ {
15843 0 : __pyx_r = 'F';
15844 0 : goto __pyx_L0;
15845 : }
15846 :
15847 : /* "View.MemoryView":1113
15848 : *
15849 : * @cname('__pyx_get_best_slice_order')
15850 : * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
15851 : * """
15852 : * Figure out the best memory access order for a given slice.
15853 : */
15854 :
15855 : /* function exit code */
15856 0 : __pyx_L0:;
15857 0 : return __pyx_r;
15858 : }
15859 :
15860 : /* "View.MemoryView":1137
15861 : *
15862 : * @cython.cdivision(True)
15863 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
15864 : * char *dst_data, Py_ssize_t *dst_strides,
15865 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
15866 : */
15867 :
15868 0 : static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
15869 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
15870 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
15871 0 : Py_ssize_t __pyx_v_dst_extent;
15872 0 : Py_ssize_t __pyx_v_src_stride;
15873 0 : Py_ssize_t __pyx_v_dst_stride;
15874 0 : int __pyx_t_1;
15875 0 : int __pyx_t_2;
15876 0 : Py_ssize_t __pyx_t_3;
15877 0 : Py_ssize_t __pyx_t_4;
15878 0 : Py_ssize_t __pyx_t_5;
15879 :
15880 : /* "View.MemoryView":1144
15881 : *
15882 : * cdef Py_ssize_t i
15883 : * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
15884 : * cdef Py_ssize_t dst_extent = dst_shape[0]
15885 : * cdef Py_ssize_t src_stride = src_strides[0]
15886 : */
15887 0 : __pyx_v_src_extent = (__pyx_v_src_shape[0]);
15888 :
15889 : /* "View.MemoryView":1145
15890 : * cdef Py_ssize_t i
15891 : * cdef Py_ssize_t src_extent = src_shape[0]
15892 : * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
15893 : * cdef Py_ssize_t src_stride = src_strides[0]
15894 : * cdef Py_ssize_t dst_stride = dst_strides[0]
15895 : */
15896 0 : __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
15897 :
15898 : /* "View.MemoryView":1146
15899 : * cdef Py_ssize_t src_extent = src_shape[0]
15900 : * cdef Py_ssize_t dst_extent = dst_shape[0]
15901 : * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
15902 : * cdef Py_ssize_t dst_stride = dst_strides[0]
15903 : *
15904 : */
15905 0 : __pyx_v_src_stride = (__pyx_v_src_strides[0]);
15906 :
15907 : /* "View.MemoryView":1147
15908 : * cdef Py_ssize_t dst_extent = dst_shape[0]
15909 : * cdef Py_ssize_t src_stride = src_strides[0]
15910 : * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
15911 : *
15912 : * if ndim == 1:
15913 : */
15914 0 : __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
15915 :
15916 : /* "View.MemoryView":1149
15917 : * cdef Py_ssize_t dst_stride = dst_strides[0]
15918 : *
15919 : * if ndim == 1: # <<<<<<<<<<<<<<
15920 : * if (src_stride > 0 and dst_stride > 0 and
15921 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15922 : */
15923 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
15924 0 : if (__pyx_t_1) {
15925 :
15926 : /* "View.MemoryView":1150
15927 : *
15928 : * if ndim == 1:
15929 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15930 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15931 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15932 : */
15933 0 : __pyx_t_2 = (__pyx_v_src_stride > 0);
15934 0 : if (__pyx_t_2) {
15935 0 : } else {
15936 0 : __pyx_t_1 = __pyx_t_2;
15937 0 : goto __pyx_L5_bool_binop_done;
15938 : }
15939 0 : __pyx_t_2 = (__pyx_v_dst_stride > 0);
15940 0 : if (__pyx_t_2) {
15941 0 : } else {
15942 0 : __pyx_t_1 = __pyx_t_2;
15943 0 : goto __pyx_L5_bool_binop_done;
15944 : }
15945 :
15946 : /* "View.MemoryView":1151
15947 : * if ndim == 1:
15948 : * if (src_stride > 0 and dst_stride > 0 and
15949 : * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
15950 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15951 : * else:
15952 : */
15953 0 : __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
15954 0 : if (__pyx_t_2) {
15955 0 : __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
15956 : }
15957 : __pyx_t_1 = __pyx_t_2;
15958 0 : __pyx_L5_bool_binop_done:;
15959 :
15960 : /* "View.MemoryView":1150
15961 : *
15962 : * if ndim == 1:
15963 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15964 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15965 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15966 : */
15967 0 : if (__pyx_t_1) {
15968 :
15969 : /* "View.MemoryView":1152
15970 : * if (src_stride > 0 and dst_stride > 0 and
15971 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15972 : * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
15973 : * else:
15974 : * for i in range(dst_extent):
15975 : */
15976 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
15977 :
15978 : /* "View.MemoryView":1150
15979 : *
15980 : * if ndim == 1:
15981 : * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
15982 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
15983 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15984 : */
15985 0 : goto __pyx_L4;
15986 : }
15987 :
15988 : /* "View.MemoryView":1154
15989 : * memcpy(dst_data, src_data, itemsize * dst_extent)
15990 : * else:
15991 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
15992 : * memcpy(dst_data, src_data, itemsize)
15993 : * src_data += src_stride
15994 : */
15995 : /*else*/ {
15996 : __pyx_t_3 = __pyx_v_dst_extent;
15997 : __pyx_t_4 = __pyx_t_3;
15998 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
15999 0 : __pyx_v_i = __pyx_t_5;
16000 :
16001 : /* "View.MemoryView":1155
16002 : * else:
16003 : * for i in range(dst_extent):
16004 : * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
16005 : * src_data += src_stride
16006 : * dst_data += dst_stride
16007 : */
16008 0 : (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
16009 :
16010 : /* "View.MemoryView":1156
16011 : * for i in range(dst_extent):
16012 : * memcpy(dst_data, src_data, itemsize)
16013 : * src_data += src_stride # <<<<<<<<<<<<<<
16014 : * dst_data += dst_stride
16015 : * else:
16016 : */
16017 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16018 :
16019 : /* "View.MemoryView":1157
16020 : * memcpy(dst_data, src_data, itemsize)
16021 : * src_data += src_stride
16022 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16023 : * else:
16024 : * for i in range(dst_extent):
16025 : */
16026 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16027 : }
16028 : }
16029 0 : __pyx_L4:;
16030 :
16031 : /* "View.MemoryView":1149
16032 : * cdef Py_ssize_t dst_stride = dst_strides[0]
16033 : *
16034 : * if ndim == 1: # <<<<<<<<<<<<<<
16035 : * if (src_stride > 0 and dst_stride > 0 and
16036 : * <size_t> src_stride == itemsize == <size_t> dst_stride):
16037 : */
16038 0 : goto __pyx_L3;
16039 : }
16040 :
16041 : /* "View.MemoryView":1159
16042 : * dst_data += dst_stride
16043 : * else:
16044 : * for i in range(dst_extent): # <<<<<<<<<<<<<<
16045 : * _copy_strided_to_strided(src_data, src_strides + 1,
16046 : * dst_data, dst_strides + 1,
16047 : */
16048 : /*else*/ {
16049 : __pyx_t_3 = __pyx_v_dst_extent;
16050 : __pyx_t_4 = __pyx_t_3;
16051 0 : for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16052 0 : __pyx_v_i = __pyx_t_5;
16053 :
16054 : /* "View.MemoryView":1160
16055 : * else:
16056 : * for i in range(dst_extent):
16057 : * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
16058 : * dst_data, dst_strides + 1,
16059 : * src_shape + 1, dst_shape + 1,
16060 : */
16061 0 : _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
16062 :
16063 : /* "View.MemoryView":1164
16064 : * src_shape + 1, dst_shape + 1,
16065 : * ndim - 1, itemsize)
16066 : * src_data += src_stride # <<<<<<<<<<<<<<
16067 : * dst_data += dst_stride
16068 : *
16069 : */
16070 0 : __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
16071 :
16072 : /* "View.MemoryView":1165
16073 : * ndim - 1, itemsize)
16074 : * src_data += src_stride
16075 : * dst_data += dst_stride # <<<<<<<<<<<<<<
16076 : *
16077 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
16078 : */
16079 0 : __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
16080 : }
16081 : }
16082 0 : __pyx_L3:;
16083 :
16084 : /* "View.MemoryView":1137
16085 : *
16086 : * @cython.cdivision(True)
16087 : * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
16088 : * char *dst_data, Py_ssize_t *dst_strides,
16089 : * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
16090 : */
16091 :
16092 : /* function exit code */
16093 0 : }
16094 :
16095 : /* "View.MemoryView":1167
16096 : * dst_data += dst_stride
16097 : *
16098 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16099 : * __Pyx_memviewslice *dst,
16100 : * int ndim, size_t itemsize) noexcept nogil:
16101 : */
16102 :
16103 0 : static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
16104 :
16105 : /* "View.MemoryView":1170
16106 : * __Pyx_memviewslice *dst,
16107 : * int ndim, size_t itemsize) noexcept nogil:
16108 : * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
16109 : * src.shape, dst.shape, ndim, itemsize)
16110 : *
16111 : */
16112 0 : _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
16113 :
16114 : /* "View.MemoryView":1167
16115 : * dst_data += dst_stride
16116 : *
16117 : * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16118 : * __Pyx_memviewslice *dst,
16119 : * int ndim, size_t itemsize) noexcept nogil:
16120 : */
16121 :
16122 : /* function exit code */
16123 0 : }
16124 :
16125 : /* "View.MemoryView":1174
16126 : *
16127 : * @cname('__pyx_memoryview_slice_get_size')
16128 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16129 : * "Return the size of the memory occupied by the slice in number of bytes"
16130 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16131 : */
16132 :
16133 0 : static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
16134 0 : Py_ssize_t __pyx_v_shape;
16135 0 : Py_ssize_t __pyx_v_size;
16136 0 : Py_ssize_t __pyx_r;
16137 0 : Py_ssize_t __pyx_t_1;
16138 0 : Py_ssize_t *__pyx_t_2;
16139 0 : Py_ssize_t *__pyx_t_3;
16140 0 : Py_ssize_t *__pyx_t_4;
16141 :
16142 : /* "View.MemoryView":1176
16143 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil:
16144 : * "Return the size of the memory occupied by the slice in number of bytes"
16145 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
16146 : *
16147 : * for shape in src.shape[:ndim]:
16148 : */
16149 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16150 0 : __pyx_v_size = __pyx_t_1;
16151 :
16152 : /* "View.MemoryView":1178
16153 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16154 : *
16155 : * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
16156 : * size *= shape
16157 : *
16158 : */
16159 0 : __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
16160 0 : for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
16161 0 : __pyx_t_2 = __pyx_t_4;
16162 0 : __pyx_v_shape = (__pyx_t_2[0]);
16163 :
16164 : /* "View.MemoryView":1179
16165 : *
16166 : * for shape in src.shape[:ndim]:
16167 : * size *= shape # <<<<<<<<<<<<<<
16168 : *
16169 : * return size
16170 : */
16171 0 : __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
16172 : }
16173 :
16174 : /* "View.MemoryView":1181
16175 : * size *= shape
16176 : *
16177 : * return size # <<<<<<<<<<<<<<
16178 : *
16179 : * @cname('__pyx_fill_contig_strides_array')
16180 : */
16181 0 : __pyx_r = __pyx_v_size;
16182 0 : goto __pyx_L0;
16183 :
16184 : /* "View.MemoryView":1174
16185 : *
16186 : * @cname('__pyx_memoryview_slice_get_size')
16187 : * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) noexcept nogil: # <<<<<<<<<<<<<<
16188 : * "Return the size of the memory occupied by the slice in number of bytes"
16189 : * cdef Py_ssize_t shape, size = src.memview.view.itemsize
16190 : */
16191 :
16192 : /* function exit code */
16193 0 : __pyx_L0:;
16194 0 : return __pyx_r;
16195 : }
16196 :
16197 : /* "View.MemoryView":1184
16198 : *
16199 : * @cname('__pyx_fill_contig_strides_array')
16200 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16201 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16202 : * int ndim, char order) noexcept nogil:
16203 : */
16204 :
16205 0 : static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
16206 0 : int __pyx_v_idx;
16207 0 : Py_ssize_t __pyx_r;
16208 0 : int __pyx_t_1;
16209 0 : int __pyx_t_2;
16210 0 : int __pyx_t_3;
16211 0 : int __pyx_t_4;
16212 :
16213 : /* "View.MemoryView":1193
16214 : * cdef int idx
16215 : *
16216 : * if order == 'F': # <<<<<<<<<<<<<<
16217 : * for idx in range(ndim):
16218 : * strides[idx] = stride
16219 : */
16220 0 : __pyx_t_1 = (__pyx_v_order == 'F');
16221 0 : if (__pyx_t_1) {
16222 :
16223 : /* "View.MemoryView":1194
16224 : *
16225 : * if order == 'F':
16226 : * for idx in range(ndim): # <<<<<<<<<<<<<<
16227 : * strides[idx] = stride
16228 : * stride *= shape[idx]
16229 : */
16230 0 : __pyx_t_2 = __pyx_v_ndim;
16231 : __pyx_t_3 = __pyx_t_2;
16232 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16233 0 : __pyx_v_idx = __pyx_t_4;
16234 :
16235 : /* "View.MemoryView":1195
16236 : * if order == 'F':
16237 : * for idx in range(ndim):
16238 : * strides[idx] = stride # <<<<<<<<<<<<<<
16239 : * stride *= shape[idx]
16240 : * else:
16241 : */
16242 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16243 :
16244 : /* "View.MemoryView":1196
16245 : * for idx in range(ndim):
16246 : * strides[idx] = stride
16247 : * stride *= shape[idx] # <<<<<<<<<<<<<<
16248 : * else:
16249 : * for idx in range(ndim - 1, -1, -1):
16250 : */
16251 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16252 : }
16253 :
16254 : /* "View.MemoryView":1193
16255 : * cdef int idx
16256 : *
16257 : * if order == 'F': # <<<<<<<<<<<<<<
16258 : * for idx in range(ndim):
16259 : * strides[idx] = stride
16260 : */
16261 0 : goto __pyx_L3;
16262 : }
16263 :
16264 : /* "View.MemoryView":1198
16265 : * stride *= shape[idx]
16266 : * else:
16267 : * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
16268 : * strides[idx] = stride
16269 : * stride *= shape[idx]
16270 : */
16271 : /*else*/ {
16272 0 : for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
16273 0 : __pyx_v_idx = __pyx_t_2;
16274 :
16275 : /* "View.MemoryView":1199
16276 : * else:
16277 : * for idx in range(ndim - 1, -1, -1):
16278 : * strides[idx] = stride # <<<<<<<<<<<<<<
16279 : * stride *= shape[idx]
16280 : *
16281 : */
16282 0 : (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
16283 :
16284 : /* "View.MemoryView":1200
16285 : * for idx in range(ndim - 1, -1, -1):
16286 : * strides[idx] = stride
16287 : * stride *= shape[idx] # <<<<<<<<<<<<<<
16288 : *
16289 : * return stride
16290 : */
16291 0 : __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
16292 : }
16293 : }
16294 0 : __pyx_L3:;
16295 :
16296 : /* "View.MemoryView":1202
16297 : * stride *= shape[idx]
16298 : *
16299 : * return stride # <<<<<<<<<<<<<<
16300 : *
16301 : * @cname('__pyx_memoryview_copy_data_to_temp')
16302 : */
16303 0 : __pyx_r = __pyx_v_stride;
16304 0 : goto __pyx_L0;
16305 :
16306 : /* "View.MemoryView":1184
16307 : *
16308 : * @cname('__pyx_fill_contig_strides_array')
16309 : * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
16310 : * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
16311 : * int ndim, char order) noexcept nogil:
16312 : */
16313 :
16314 : /* function exit code */
16315 0 : __pyx_L0:;
16316 0 : return __pyx_r;
16317 : }
16318 :
16319 : /* "View.MemoryView":1205
16320 : *
16321 : * @cname('__pyx_memoryview_copy_data_to_temp')
16322 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16323 : * __Pyx_memviewslice *tmpslice,
16324 : * char order,
16325 : */
16326 :
16327 0 : static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
16328 0 : int __pyx_v_i;
16329 0 : void *__pyx_v_result;
16330 0 : size_t __pyx_v_itemsize;
16331 0 : size_t __pyx_v_size;
16332 0 : void *__pyx_r;
16333 0 : Py_ssize_t __pyx_t_1;
16334 0 : int __pyx_t_2;
16335 0 : int __pyx_t_3;
16336 0 : struct __pyx_memoryview_obj *__pyx_t_4;
16337 0 : int __pyx_t_5;
16338 0 : int __pyx_t_6;
16339 0 : int __pyx_lineno = 0;
16340 0 : const char *__pyx_filename = NULL;
16341 0 : int __pyx_clineno = 0;
16342 : #ifdef WITH_THREAD
16343 0 : PyGILState_STATE __pyx_gilstate_save;
16344 : #endif
16345 :
16346 : /* "View.MemoryView":1216
16347 : * cdef void *result
16348 : *
16349 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
16350 : * cdef size_t size = slice_get_size(src, ndim)
16351 : *
16352 : */
16353 0 : __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
16354 0 : __pyx_v_itemsize = __pyx_t_1;
16355 :
16356 : /* "View.MemoryView":1217
16357 : *
16358 : * cdef size_t itemsize = src.memview.view.itemsize
16359 : * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
16360 : *
16361 : * result = malloc(size)
16362 : */
16363 0 : __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
16364 :
16365 : /* "View.MemoryView":1219
16366 : * cdef size_t size = slice_get_size(src, ndim)
16367 : *
16368 : * result = malloc(size) # <<<<<<<<<<<<<<
16369 : * if not result:
16370 : * _err_no_memory()
16371 : */
16372 0 : __pyx_v_result = malloc(__pyx_v_size);
16373 :
16374 : /* "View.MemoryView":1220
16375 : *
16376 : * result = malloc(size)
16377 : * if not result: # <<<<<<<<<<<<<<
16378 : * _err_no_memory()
16379 : *
16380 : */
16381 0 : __pyx_t_2 = (!(__pyx_v_result != 0));
16382 0 : if (__pyx_t_2) {
16383 :
16384 : /* "View.MemoryView":1221
16385 : * result = malloc(size)
16386 : * if not result:
16387 : * _err_no_memory() # <<<<<<<<<<<<<<
16388 : *
16389 : *
16390 : */
16391 0 : __pyx_t_3 = __pyx_memoryview_err_no_memory(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1221, __pyx_L1_error)
16392 :
16393 : /* "View.MemoryView":1220
16394 : *
16395 : * result = malloc(size)
16396 : * if not result: # <<<<<<<<<<<<<<
16397 : * _err_no_memory()
16398 : *
16399 : */
16400 : }
16401 :
16402 : /* "View.MemoryView":1224
16403 : *
16404 : *
16405 : * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
16406 : * tmpslice.memview = src.memview
16407 : * for i in range(ndim):
16408 : */
16409 0 : __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
16410 :
16411 : /* "View.MemoryView":1225
16412 : *
16413 : * tmpslice.data = <char *> result
16414 : * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
16415 : * for i in range(ndim):
16416 : * tmpslice.shape[i] = src.shape[i]
16417 : */
16418 0 : __pyx_t_4 = __pyx_v_src->memview;
16419 0 : __pyx_v_tmpslice->memview = __pyx_t_4;
16420 :
16421 : /* "View.MemoryView":1226
16422 : * tmpslice.data = <char *> result
16423 : * tmpslice.memview = src.memview
16424 : * for i in range(ndim): # <<<<<<<<<<<<<<
16425 : * tmpslice.shape[i] = src.shape[i]
16426 : * tmpslice.suboffsets[i] = -1
16427 : */
16428 0 : __pyx_t_3 = __pyx_v_ndim;
16429 0 : __pyx_t_5 = __pyx_t_3;
16430 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16431 0 : __pyx_v_i = __pyx_t_6;
16432 :
16433 : /* "View.MemoryView":1227
16434 : * tmpslice.memview = src.memview
16435 : * for i in range(ndim):
16436 : * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
16437 : * tmpslice.suboffsets[i] = -1
16438 : *
16439 : */
16440 0 : (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
16441 :
16442 : /* "View.MemoryView":1228
16443 : * for i in range(ndim):
16444 : * tmpslice.shape[i] = src.shape[i]
16445 : * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
16446 : *
16447 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order)
16448 : */
16449 0 : (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
16450 : }
16451 :
16452 : /* "View.MemoryView":1230
16453 : * tmpslice.suboffsets[i] = -1
16454 : *
16455 : * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, ndim, order) # <<<<<<<<<<<<<<
16456 : *
16457 : *
16458 : */
16459 0 : (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
16460 :
16461 : /* "View.MemoryView":1233
16462 : *
16463 : *
16464 : * for i in range(ndim): # <<<<<<<<<<<<<<
16465 : * if tmpslice.shape[i] == 1:
16466 : * tmpslice.strides[i] = 0
16467 : */
16468 0 : __pyx_t_3 = __pyx_v_ndim;
16469 0 : __pyx_t_5 = __pyx_t_3;
16470 0 : for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
16471 0 : __pyx_v_i = __pyx_t_6;
16472 :
16473 : /* "View.MemoryView":1234
16474 : *
16475 : * for i in range(ndim):
16476 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16477 : * tmpslice.strides[i] = 0
16478 : *
16479 : */
16480 0 : __pyx_t_2 = ((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1);
16481 0 : if (__pyx_t_2) {
16482 :
16483 : /* "View.MemoryView":1235
16484 : * for i in range(ndim):
16485 : * if tmpslice.shape[i] == 1:
16486 : * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
16487 : *
16488 : * if slice_is_contig(src[0], order, ndim):
16489 : */
16490 0 : (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
16491 :
16492 : /* "View.MemoryView":1234
16493 : *
16494 : * for i in range(ndim):
16495 : * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
16496 : * tmpslice.strides[i] = 0
16497 : *
16498 : */
16499 : }
16500 : }
16501 :
16502 : /* "View.MemoryView":1237
16503 : * tmpslice.strides[i] = 0
16504 : *
16505 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16506 : * memcpy(result, src.data, size)
16507 : * else:
16508 : */
16509 0 : __pyx_t_2 = __pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim);
16510 0 : if (__pyx_t_2) {
16511 :
16512 : /* "View.MemoryView":1238
16513 : *
16514 : * if slice_is_contig(src[0], order, ndim):
16515 : * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
16516 : * else:
16517 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16518 : */
16519 0 : (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
16520 :
16521 : /* "View.MemoryView":1237
16522 : * tmpslice.strides[i] = 0
16523 : *
16524 : * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
16525 : * memcpy(result, src.data, size)
16526 : * else:
16527 : */
16528 0 : goto __pyx_L9;
16529 : }
16530 :
16531 : /* "View.MemoryView":1240
16532 : * memcpy(result, src.data, size)
16533 : * else:
16534 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
16535 : *
16536 : * return result
16537 : */
16538 : /*else*/ {
16539 0 : copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
16540 : }
16541 0 : __pyx_L9:;
16542 :
16543 : /* "View.MemoryView":1242
16544 : * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
16545 : *
16546 : * return result # <<<<<<<<<<<<<<
16547 : *
16548 : *
16549 : */
16550 0 : __pyx_r = __pyx_v_result;
16551 0 : goto __pyx_L0;
16552 :
16553 : /* "View.MemoryView":1205
16554 : *
16555 : * @cname('__pyx_memoryview_copy_data_to_temp')
16556 : * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
16557 : * __Pyx_memviewslice *tmpslice,
16558 : * char order,
16559 : */
16560 :
16561 : /* function exit code */
16562 0 : __pyx_L1_error:;
16563 : #ifdef WITH_THREAD
16564 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16565 : #endif
16566 0 : __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
16567 0 : __pyx_r = NULL;
16568 : #ifdef WITH_THREAD
16569 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16570 : #endif
16571 0 : __pyx_L0:;
16572 0 : return __pyx_r;
16573 : }
16574 :
16575 : /* "View.MemoryView":1247
16576 : *
16577 : * @cname('__pyx_memoryview_err_extents')
16578 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16579 : * Py_ssize_t extent2) except -1 with gil:
16580 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
16581 : */
16582 :
16583 0 : static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
16584 0 : int __pyx_r;
16585 : __Pyx_RefNannyDeclarations
16586 0 : PyObject *__pyx_t_1 = NULL;
16587 0 : Py_ssize_t __pyx_t_2;
16588 0 : Py_UCS4 __pyx_t_3;
16589 0 : PyObject *__pyx_t_4 = NULL;
16590 0 : int __pyx_lineno = 0;
16591 0 : const char *__pyx_filename = NULL;
16592 0 : int __pyx_clineno = 0;
16593 : #ifdef WITH_THREAD
16594 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16595 : #endif
16596 0 : __Pyx_RefNannySetupContext("_err_extents", 0);
16597 :
16598 : /* "View.MemoryView":1249
16599 : * cdef int _err_extents(int i, Py_ssize_t extent1,
16600 : * Py_ssize_t extent2) except -1 with gil:
16601 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})" # <<<<<<<<<<<<<<
16602 : *
16603 : * @cname('__pyx_memoryview_err_dim')
16604 : */
16605 0 : __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1249, __pyx_L1_error)
16606 0 : __Pyx_GOTREF(__pyx_t_1);
16607 0 : __pyx_t_2 = 0;
16608 0 : __pyx_t_3 = 127;
16609 0 : __Pyx_INCREF(__pyx_kp_u_got_differing_extents_in_dimensi);
16610 0 : __pyx_t_2 += 35;
16611 0 : __Pyx_GIVEREF(__pyx_kp_u_got_differing_extents_in_dimensi);
16612 0 : PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_got_differing_extents_in_dimensi);
16613 0 : __pyx_t_4 = __Pyx_PyUnicode_From_int(__pyx_v_i, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16614 0 : __Pyx_GOTREF(__pyx_t_4);
16615 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16616 0 : __Pyx_GIVEREF(__pyx_t_4);
16617 0 : PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
16618 0 : __pyx_t_4 = 0;
16619 0 : __Pyx_INCREF(__pyx_kp_u_got);
16620 0 : __pyx_t_2 += 6;
16621 0 : __Pyx_GIVEREF(__pyx_kp_u_got);
16622 0 : PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_got);
16623 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent1, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16624 0 : __Pyx_GOTREF(__pyx_t_4);
16625 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16626 0 : __Pyx_GIVEREF(__pyx_t_4);
16627 0 : PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4);
16628 0 : __pyx_t_4 = 0;
16629 0 : __Pyx_INCREF(__pyx_kp_u_and);
16630 0 : __pyx_t_2 += 5;
16631 0 : __Pyx_GIVEREF(__pyx_kp_u_and);
16632 0 : PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_and);
16633 0 : __pyx_t_4 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_extent2, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16634 0 : __Pyx_GOTREF(__pyx_t_4);
16635 0 : __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
16636 0 : __Pyx_GIVEREF(__pyx_t_4);
16637 0 : PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_4);
16638 0 : __pyx_t_4 = 0;
16639 0 : __Pyx_INCREF(__pyx_kp_u__7);
16640 0 : __pyx_t_2 += 1;
16641 0 : __Pyx_GIVEREF(__pyx_kp_u__7);
16642 0 : PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7);
16643 0 : __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1249, __pyx_L1_error)
16644 0 : __Pyx_GOTREF(__pyx_t_4);
16645 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16646 0 : __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_4, 0, 0);
16647 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16648 0 : __PYX_ERR(1, 1249, __pyx_L1_error)
16649 :
16650 : /* "View.MemoryView":1247
16651 : *
16652 : * @cname('__pyx_memoryview_err_extents')
16653 : * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
16654 : * Py_ssize_t extent2) except -1 with gil:
16655 : * raise ValueError, f"got differing extents in dimension {i} (got {extent1} and {extent2})"
16656 : */
16657 :
16658 : /* function exit code */
16659 0 : __pyx_L1_error:;
16660 0 : __Pyx_XDECREF(__pyx_t_1);
16661 0 : __Pyx_XDECREF(__pyx_t_4);
16662 0 : __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
16663 0 : __pyx_r = -1;
16664 0 : __Pyx_RefNannyFinishContext();
16665 : #ifdef WITH_THREAD
16666 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16667 : #endif
16668 0 : return __pyx_r;
16669 : }
16670 :
16671 : /* "View.MemoryView":1252
16672 : *
16673 : * @cname('__pyx_memoryview_err_dim')
16674 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16675 : * raise <object>error, msg % dim
16676 : *
16677 : */
16678 :
16679 0 : static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, PyObject *__pyx_v_msg, int __pyx_v_dim) {
16680 0 : int __pyx_r;
16681 : __Pyx_RefNannyDeclarations
16682 0 : PyObject *__pyx_t_1 = NULL;
16683 0 : PyObject *__pyx_t_2 = NULL;
16684 0 : int __pyx_lineno = 0;
16685 0 : const char *__pyx_filename = NULL;
16686 0 : int __pyx_clineno = 0;
16687 : #ifdef WITH_THREAD
16688 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16689 : #endif
16690 0 : __Pyx_RefNannySetupContext("_err_dim", 0);
16691 0 : __Pyx_INCREF(__pyx_v_msg);
16692 :
16693 : /* "View.MemoryView":1253
16694 : * @cname('__pyx_memoryview_err_dim')
16695 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil:
16696 : * raise <object>error, msg % dim # <<<<<<<<<<<<<<
16697 : *
16698 : * @cname('__pyx_memoryview_err')
16699 : */
16700 0 : __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1253, __pyx_L1_error)
16701 0 : __Pyx_GOTREF(__pyx_t_1);
16702 0 : __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1253, __pyx_L1_error)
16703 0 : __Pyx_GOTREF(__pyx_t_2);
16704 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16705 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_t_2, 0, 0);
16706 0 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16707 0 : __PYX_ERR(1, 1253, __pyx_L1_error)
16708 :
16709 : /* "View.MemoryView":1252
16710 : *
16711 : * @cname('__pyx_memoryview_err_dim')
16712 : * cdef int _err_dim(PyObject *error, str msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
16713 : * raise <object>error, msg % dim
16714 : *
16715 : */
16716 :
16717 : /* function exit code */
16718 0 : __pyx_L1_error:;
16719 0 : __Pyx_XDECREF(__pyx_t_1);
16720 0 : __Pyx_XDECREF(__pyx_t_2);
16721 0 : __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
16722 0 : __pyx_r = -1;
16723 0 : __Pyx_XDECREF(__pyx_v_msg);
16724 0 : __Pyx_RefNannyFinishContext();
16725 : #ifdef WITH_THREAD
16726 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16727 : #endif
16728 0 : return __pyx_r;
16729 : }
16730 :
16731 : /* "View.MemoryView":1256
16732 : *
16733 : * @cname('__pyx_memoryview_err')
16734 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
16735 : * raise <object>error, msg
16736 : *
16737 : */
16738 :
16739 0 : static int __pyx_memoryview_err(PyObject *__pyx_v_error, PyObject *__pyx_v_msg) {
16740 0 : int __pyx_r;
16741 : __Pyx_RefNannyDeclarations
16742 0 : int __pyx_lineno = 0;
16743 0 : const char *__pyx_filename = NULL;
16744 0 : int __pyx_clineno = 0;
16745 : #ifdef WITH_THREAD
16746 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16747 : #endif
16748 0 : __Pyx_RefNannySetupContext("_err", 0);
16749 0 : __Pyx_INCREF(__pyx_v_msg);
16750 :
16751 : /* "View.MemoryView":1257
16752 : * @cname('__pyx_memoryview_err')
16753 : * cdef int _err(PyObject *error, str msg) except -1 with gil:
16754 : * raise <object>error, msg # <<<<<<<<<<<<<<
16755 : *
16756 : * @cname('__pyx_memoryview_err_no_memory')
16757 : */
16758 0 : __Pyx_Raise(((PyObject *)__pyx_v_error), __pyx_v_msg, 0, 0);
16759 0 : __PYX_ERR(1, 1257, __pyx_L1_error)
16760 :
16761 : /* "View.MemoryView":1256
16762 : *
16763 : * @cname('__pyx_memoryview_err')
16764 : * cdef int _err(PyObject *error, str msg) except -1 with gil: # <<<<<<<<<<<<<<
16765 : * raise <object>error, msg
16766 : *
16767 : */
16768 :
16769 : /* function exit code */
16770 0 : __pyx_L1_error:;
16771 0 : __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
16772 0 : __pyx_r = -1;
16773 0 : __Pyx_XDECREF(__pyx_v_msg);
16774 0 : __Pyx_RefNannyFinishContext();
16775 : #ifdef WITH_THREAD
16776 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16777 : #endif
16778 0 : return __pyx_r;
16779 : }
16780 :
16781 : /* "View.MemoryView":1260
16782 : *
16783 : * @cname('__pyx_memoryview_err_no_memory')
16784 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
16785 : * raise MemoryError
16786 : *
16787 : */
16788 :
16789 0 : static int __pyx_memoryview_err_no_memory(void) {
16790 0 : int __pyx_r;
16791 0 : int __pyx_lineno = 0;
16792 0 : const char *__pyx_filename = NULL;
16793 0 : int __pyx_clineno = 0;
16794 : #ifdef WITH_THREAD
16795 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16796 : #endif
16797 :
16798 : /* "View.MemoryView":1261
16799 : * @cname('__pyx_memoryview_err_no_memory')
16800 : * cdef int _err_no_memory() except -1 with gil:
16801 : * raise MemoryError # <<<<<<<<<<<<<<
16802 : *
16803 : *
16804 : */
16805 0 : PyErr_NoMemory(); __PYX_ERR(1, 1261, __pyx_L1_error)
16806 :
16807 : /* "View.MemoryView":1260
16808 : *
16809 : * @cname('__pyx_memoryview_err_no_memory')
16810 : * cdef int _err_no_memory() except -1 with gil: # <<<<<<<<<<<<<<
16811 : * raise MemoryError
16812 : *
16813 : */
16814 :
16815 : /* function exit code */
16816 0 : __pyx_L1_error:;
16817 0 : __Pyx_AddTraceback("View.MemoryView._err_no_memory", __pyx_clineno, __pyx_lineno, __pyx_filename);
16818 0 : __pyx_r = -1;
16819 : #ifdef WITH_THREAD
16820 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
16821 : #endif
16822 0 : return __pyx_r;
16823 : }
16824 :
16825 : /* "View.MemoryView":1265
16826 : *
16827 : * @cname('__pyx_memoryview_copy_contents')
16828 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
16829 : * __Pyx_memviewslice dst,
16830 : * int src_ndim, int dst_ndim,
16831 : */
16832 :
16833 0 : static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
16834 0 : void *__pyx_v_tmpdata;
16835 0 : size_t __pyx_v_itemsize;
16836 0 : int __pyx_v_i;
16837 0 : char __pyx_v_order;
16838 0 : int __pyx_v_broadcasting;
16839 0 : int __pyx_v_direct_copy;
16840 0 : __Pyx_memviewslice __pyx_v_tmp;
16841 0 : int __pyx_v_ndim;
16842 0 : int __pyx_r;
16843 0 : Py_ssize_t __pyx_t_1;
16844 0 : int __pyx_t_2;
16845 0 : int __pyx_t_3;
16846 0 : int __pyx_t_4;
16847 0 : int __pyx_t_5;
16848 0 : int __pyx_t_6;
16849 0 : void *__pyx_t_7;
16850 0 : int __pyx_lineno = 0;
16851 0 : const char *__pyx_filename = NULL;
16852 0 : int __pyx_clineno = 0;
16853 : #ifdef WITH_THREAD
16854 0 : PyGILState_STATE __pyx_gilstate_save;
16855 : #endif
16856 :
16857 : /* "View.MemoryView":1273
16858 : * Check for overlapping memory and verify the shapes.
16859 : * """
16860 : * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
16861 : * cdef size_t itemsize = src.memview.view.itemsize
16862 : * cdef int i
16863 : */
16864 0 : __pyx_v_tmpdata = NULL;
16865 :
16866 : /* "View.MemoryView":1274
16867 : * """
16868 : * cdef void *tmpdata = NULL
16869 : * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
16870 : * cdef int i
16871 : * cdef char order = get_best_order(&src, src_ndim)
16872 : */
16873 0 : __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
16874 0 : __pyx_v_itemsize = __pyx_t_1;
16875 :
16876 : /* "View.MemoryView":1276
16877 : * cdef size_t itemsize = src.memview.view.itemsize
16878 : * cdef int i
16879 : * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
16880 : * cdef bint broadcasting = False
16881 : * cdef bint direct_copy = False
16882 : */
16883 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
16884 :
16885 : /* "View.MemoryView":1277
16886 : * cdef int i
16887 : * cdef char order = get_best_order(&src, src_ndim)
16888 : * cdef bint broadcasting = False # <<<<<<<<<<<<<<
16889 : * cdef bint direct_copy = False
16890 : * cdef __Pyx_memviewslice tmp
16891 : */
16892 0 : __pyx_v_broadcasting = 0;
16893 :
16894 : /* "View.MemoryView":1278
16895 : * cdef char order = get_best_order(&src, src_ndim)
16896 : * cdef bint broadcasting = False
16897 : * cdef bint direct_copy = False # <<<<<<<<<<<<<<
16898 : * cdef __Pyx_memviewslice tmp
16899 : *
16900 : */
16901 0 : __pyx_v_direct_copy = 0;
16902 :
16903 : /* "View.MemoryView":1281
16904 : * cdef __Pyx_memviewslice tmp
16905 : *
16906 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
16907 : * broadcast_leading(&src, src_ndim, dst_ndim)
16908 : * elif dst_ndim < src_ndim:
16909 : */
16910 0 : __pyx_t_2 = (__pyx_v_src_ndim < __pyx_v_dst_ndim);
16911 0 : if (__pyx_t_2) {
16912 :
16913 : /* "View.MemoryView":1282
16914 : *
16915 : * if src_ndim < dst_ndim:
16916 : * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
16917 : * elif dst_ndim < src_ndim:
16918 : * broadcast_leading(&dst, dst_ndim, src_ndim)
16919 : */
16920 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
16921 :
16922 : /* "View.MemoryView":1281
16923 : * cdef __Pyx_memviewslice tmp
16924 : *
16925 : * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
16926 : * broadcast_leading(&src, src_ndim, dst_ndim)
16927 : * elif dst_ndim < src_ndim:
16928 : */
16929 0 : goto __pyx_L3;
16930 : }
16931 :
16932 : /* "View.MemoryView":1283
16933 : * if src_ndim < dst_ndim:
16934 : * broadcast_leading(&src, src_ndim, dst_ndim)
16935 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
16936 : * broadcast_leading(&dst, dst_ndim, src_ndim)
16937 : *
16938 : */
16939 0 : __pyx_t_2 = (__pyx_v_dst_ndim < __pyx_v_src_ndim);
16940 0 : if (__pyx_t_2) {
16941 :
16942 : /* "View.MemoryView":1284
16943 : * broadcast_leading(&src, src_ndim, dst_ndim)
16944 : * elif dst_ndim < src_ndim:
16945 : * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
16946 : *
16947 : * cdef int ndim = max(src_ndim, dst_ndim)
16948 : */
16949 0 : __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
16950 :
16951 : /* "View.MemoryView":1283
16952 : * if src_ndim < dst_ndim:
16953 : * broadcast_leading(&src, src_ndim, dst_ndim)
16954 : * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
16955 : * broadcast_leading(&dst, dst_ndim, src_ndim)
16956 : *
16957 : */
16958 : }
16959 0 : __pyx_L3:;
16960 :
16961 : /* "View.MemoryView":1286
16962 : * broadcast_leading(&dst, dst_ndim, src_ndim)
16963 : *
16964 : * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
16965 : *
16966 : * for i in range(ndim):
16967 : */
16968 0 : __pyx_t_3 = __pyx_v_dst_ndim;
16969 0 : __pyx_t_4 = __pyx_v_src_ndim;
16970 0 : __pyx_t_2 = (__pyx_t_3 > __pyx_t_4);
16971 0 : if (__pyx_t_2) {
16972 : __pyx_t_5 = __pyx_t_3;
16973 : } else {
16974 : __pyx_t_5 = __pyx_t_4;
16975 : }
16976 0 : __pyx_v_ndim = __pyx_t_5;
16977 :
16978 : /* "View.MemoryView":1288
16979 : * cdef int ndim = max(src_ndim, dst_ndim)
16980 : *
16981 : * for i in range(ndim): # <<<<<<<<<<<<<<
16982 : * if src.shape[i] != dst.shape[i]:
16983 : * if src.shape[i] == 1:
16984 : */
16985 0 : __pyx_t_5 = __pyx_v_ndim;
16986 0 : __pyx_t_3 = __pyx_t_5;
16987 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
16988 0 : __pyx_v_i = __pyx_t_4;
16989 :
16990 : /* "View.MemoryView":1289
16991 : *
16992 : * for i in range(ndim):
16993 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
16994 : * if src.shape[i] == 1:
16995 : * broadcasting = True
16996 : */
16997 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i]));
16998 0 : if (__pyx_t_2) {
16999 :
17000 : /* "View.MemoryView":1290
17001 : * for i in range(ndim):
17002 : * if src.shape[i] != dst.shape[i]:
17003 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17004 : * broadcasting = True
17005 : * src.strides[i] = 0
17006 : */
17007 0 : __pyx_t_2 = ((__pyx_v_src.shape[__pyx_v_i]) == 1);
17008 0 : if (__pyx_t_2) {
17009 :
17010 : /* "View.MemoryView":1291
17011 : * if src.shape[i] != dst.shape[i]:
17012 : * if src.shape[i] == 1:
17013 : * broadcasting = True # <<<<<<<<<<<<<<
17014 : * src.strides[i] = 0
17015 : * else:
17016 : */
17017 0 : __pyx_v_broadcasting = 1;
17018 :
17019 : /* "View.MemoryView":1292
17020 : * if src.shape[i] == 1:
17021 : * broadcasting = True
17022 : * src.strides[i] = 0 # <<<<<<<<<<<<<<
17023 : * else:
17024 : * _err_extents(i, dst.shape[i], src.shape[i])
17025 : */
17026 0 : (__pyx_v_src.strides[__pyx_v_i]) = 0;
17027 :
17028 : /* "View.MemoryView":1290
17029 : * for i in range(ndim):
17030 : * if src.shape[i] != dst.shape[i]:
17031 : * if src.shape[i] == 1: # <<<<<<<<<<<<<<
17032 : * broadcasting = True
17033 : * src.strides[i] = 0
17034 : */
17035 0 : goto __pyx_L7;
17036 : }
17037 :
17038 : /* "View.MemoryView":1294
17039 : * src.strides[i] = 0
17040 : * else:
17041 : * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
17042 : *
17043 : * if src.suboffsets[i] >= 0:
17044 : */
17045 : /*else*/ {
17046 0 : __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1294, __pyx_L1_error)
17047 : }
17048 0 : __pyx_L7:;
17049 :
17050 : /* "View.MemoryView":1289
17051 : *
17052 : * for i in range(ndim):
17053 : * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
17054 : * if src.shape[i] == 1:
17055 : * broadcasting = True
17056 : */
17057 : }
17058 :
17059 : /* "View.MemoryView":1296
17060 : * _err_extents(i, dst.shape[i], src.shape[i])
17061 : *
17062 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17063 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17064 : *
17065 : */
17066 0 : __pyx_t_2 = ((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0);
17067 0 : if (__pyx_t_2) {
17068 :
17069 : /* "View.MemoryView":1297
17070 : *
17071 : * if src.suboffsets[i] >= 0:
17072 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
17073 : *
17074 : * if slices_overlap(&src, &dst, ndim, itemsize):
17075 : */
17076 0 : __pyx_t_6 = __pyx_memoryview_err_dim(PyExc_ValueError, __pyx_kp_s_Dimension_d_is_not_direct, __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
17077 :
17078 : /* "View.MemoryView":1296
17079 : * _err_extents(i, dst.shape[i], src.shape[i])
17080 : *
17081 : * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
17082 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17083 : *
17084 : */
17085 : }
17086 : }
17087 :
17088 : /* "View.MemoryView":1299
17089 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17090 : *
17091 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17092 : *
17093 : * if not slice_is_contig(src, order, ndim):
17094 : */
17095 0 : __pyx_t_2 = __pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17096 0 : if (__pyx_t_2) {
17097 :
17098 : /* "View.MemoryView":1301
17099 : * if slices_overlap(&src, &dst, ndim, itemsize):
17100 : *
17101 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17102 : * order = get_best_order(&dst, ndim)
17103 : *
17104 : */
17105 0 : __pyx_t_2 = (!__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim));
17106 0 : if (__pyx_t_2) {
17107 :
17108 : /* "View.MemoryView":1302
17109 : *
17110 : * if not slice_is_contig(src, order, ndim):
17111 : * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
17112 : *
17113 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17114 : */
17115 0 : __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
17116 :
17117 : /* "View.MemoryView":1301
17118 : * if slices_overlap(&src, &dst, ndim, itemsize):
17119 : *
17120 : * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
17121 : * order = get_best_order(&dst, ndim)
17122 : *
17123 : */
17124 : }
17125 :
17126 : /* "View.MemoryView":1304
17127 : * order = get_best_order(&dst, ndim)
17128 : *
17129 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
17130 : * src = tmp
17131 : *
17132 : */
17133 0 : __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1304, __pyx_L1_error)
17134 0 : __pyx_v_tmpdata = __pyx_t_7;
17135 :
17136 : /* "View.MemoryView":1305
17137 : *
17138 : * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
17139 : * src = tmp # <<<<<<<<<<<<<<
17140 : *
17141 : * if not broadcasting:
17142 : */
17143 0 : __pyx_v_src = __pyx_v_tmp;
17144 :
17145 : /* "View.MemoryView":1299
17146 : * _err_dim(PyExc_ValueError, "Dimension %d is not direct", i)
17147 : *
17148 : * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
17149 : *
17150 : * if not slice_is_contig(src, order, ndim):
17151 : */
17152 : }
17153 :
17154 : /* "View.MemoryView":1307
17155 : * src = tmp
17156 : *
17157 : * if not broadcasting: # <<<<<<<<<<<<<<
17158 : *
17159 : *
17160 : */
17161 0 : __pyx_t_2 = (!__pyx_v_broadcasting);
17162 0 : if (__pyx_t_2) {
17163 :
17164 : /* "View.MemoryView":1310
17165 : *
17166 : *
17167 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17168 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17169 : * elif slice_is_contig(src, 'F', ndim):
17170 : */
17171 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim);
17172 0 : if (__pyx_t_2) {
17173 :
17174 : /* "View.MemoryView":1311
17175 : *
17176 : * if slice_is_contig(src, 'C', ndim):
17177 : * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
17178 : * elif slice_is_contig(src, 'F', ndim):
17179 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17180 : */
17181 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
17182 :
17183 : /* "View.MemoryView":1310
17184 : *
17185 : *
17186 : * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
17187 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17188 : * elif slice_is_contig(src, 'F', ndim):
17189 : */
17190 0 : goto __pyx_L12;
17191 : }
17192 :
17193 : /* "View.MemoryView":1312
17194 : * if slice_is_contig(src, 'C', ndim):
17195 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17196 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17197 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17198 : *
17199 : */
17200 0 : __pyx_t_2 = __pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim);
17201 0 : if (__pyx_t_2) {
17202 :
17203 : /* "View.MemoryView":1313
17204 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17205 : * elif slice_is_contig(src, 'F', ndim):
17206 : * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
17207 : *
17208 : * if direct_copy:
17209 : */
17210 0 : __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
17211 :
17212 : /* "View.MemoryView":1312
17213 : * if slice_is_contig(src, 'C', ndim):
17214 : * direct_copy = slice_is_contig(dst, 'C', ndim)
17215 : * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
17216 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17217 : *
17218 : */
17219 : }
17220 0 : __pyx_L12:;
17221 :
17222 : /* "View.MemoryView":1315
17223 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17224 : *
17225 : * if direct_copy: # <<<<<<<<<<<<<<
17226 : *
17227 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17228 : */
17229 0 : if (__pyx_v_direct_copy) {
17230 :
17231 : /* "View.MemoryView":1317
17232 : * if direct_copy:
17233 : *
17234 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17235 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17236 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17237 : */
17238 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17239 :
17240 : /* "View.MemoryView":1318
17241 : *
17242 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17243 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
17244 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17245 : * free(tmpdata)
17246 : */
17247 0 : (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
17248 :
17249 : /* "View.MemoryView":1319
17250 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17251 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17252 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17253 : * free(tmpdata)
17254 : * return 0
17255 : */
17256 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17257 :
17258 : /* "View.MemoryView":1320
17259 : * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
17260 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17261 : * free(tmpdata) # <<<<<<<<<<<<<<
17262 : * return 0
17263 : *
17264 : */
17265 0 : free(__pyx_v_tmpdata);
17266 :
17267 : /* "View.MemoryView":1321
17268 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17269 : * free(tmpdata)
17270 : * return 0 # <<<<<<<<<<<<<<
17271 : *
17272 : * if order == 'F' == get_best_order(&dst, ndim):
17273 : */
17274 0 : __pyx_r = 0;
17275 0 : goto __pyx_L0;
17276 :
17277 : /* "View.MemoryView":1315
17278 : * direct_copy = slice_is_contig(dst, 'F', ndim)
17279 : *
17280 : * if direct_copy: # <<<<<<<<<<<<<<
17281 : *
17282 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17283 : */
17284 : }
17285 :
17286 : /* "View.MemoryView":1307
17287 : * src = tmp
17288 : *
17289 : * if not broadcasting: # <<<<<<<<<<<<<<
17290 : *
17291 : *
17292 : */
17293 : }
17294 :
17295 : /* "View.MemoryView":1323
17296 : * return 0
17297 : *
17298 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17299 : *
17300 : *
17301 : */
17302 0 : __pyx_t_2 = (__pyx_v_order == 'F');
17303 0 : if (__pyx_t_2) {
17304 0 : __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
17305 : }
17306 0 : if (__pyx_t_2) {
17307 :
17308 : /* "View.MemoryView":1326
17309 : *
17310 : *
17311 : * transpose_memslice(&src) # <<<<<<<<<<<<<<
17312 : * transpose_memslice(&dst)
17313 : *
17314 : */
17315 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1326, __pyx_L1_error)
17316 :
17317 : /* "View.MemoryView":1327
17318 : *
17319 : * transpose_memslice(&src)
17320 : * transpose_memslice(&dst) # <<<<<<<<<<<<<<
17321 : *
17322 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17323 : */
17324 0 : __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 1327, __pyx_L1_error)
17325 :
17326 : /* "View.MemoryView":1323
17327 : * return 0
17328 : *
17329 : * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
17330 : *
17331 : *
17332 : */
17333 : }
17334 :
17335 : /* "View.MemoryView":1329
17336 : * transpose_memslice(&dst)
17337 : *
17338 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17339 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17340 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17341 : */
17342 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17343 :
17344 : /* "View.MemoryView":1330
17345 : *
17346 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17347 : * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
17348 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17349 : *
17350 : */
17351 0 : copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
17352 :
17353 : /* "View.MemoryView":1331
17354 : * refcount_copying(&dst, dtype_is_object, ndim, inc=False)
17355 : * copy_strided_to_strided(&src, &dst, ndim, itemsize)
17356 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17357 : *
17358 : * free(tmpdata)
17359 : */
17360 0 : __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17361 :
17362 : /* "View.MemoryView":1333
17363 : * refcount_copying(&dst, dtype_is_object, ndim, inc=True)
17364 : *
17365 : * free(tmpdata) # <<<<<<<<<<<<<<
17366 : * return 0
17367 : *
17368 : */
17369 0 : free(__pyx_v_tmpdata);
17370 :
17371 : /* "View.MemoryView":1334
17372 : *
17373 : * free(tmpdata)
17374 : * return 0 # <<<<<<<<<<<<<<
17375 : *
17376 : * @cname('__pyx_memoryview_broadcast_leading')
17377 : */
17378 0 : __pyx_r = 0;
17379 0 : goto __pyx_L0;
17380 :
17381 : /* "View.MemoryView":1265
17382 : *
17383 : * @cname('__pyx_memoryview_copy_contents')
17384 : * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
17385 : * __Pyx_memviewslice dst,
17386 : * int src_ndim, int dst_ndim,
17387 : */
17388 :
17389 : /* function exit code */
17390 0 : __pyx_L1_error:;
17391 : #ifdef WITH_THREAD
17392 0 : __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17393 : #endif
17394 0 : __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
17395 0 : __pyx_r = -1;
17396 : #ifdef WITH_THREAD
17397 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17398 : #endif
17399 0 : __pyx_L0:;
17400 0 : return __pyx_r;
17401 : }
17402 :
17403 : /* "View.MemoryView":1337
17404 : *
17405 : * @cname('__pyx_memoryview_broadcast_leading')
17406 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17407 : * int ndim,
17408 : * int ndim_other) noexcept nogil:
17409 : */
17410 :
17411 0 : static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
17412 0 : int __pyx_v_i;
17413 0 : int __pyx_v_offset;
17414 0 : int __pyx_t_1;
17415 0 : int __pyx_t_2;
17416 0 : int __pyx_t_3;
17417 :
17418 : /* "View.MemoryView":1341
17419 : * int ndim_other) noexcept nogil:
17420 : * cdef int i
17421 : * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
17422 : *
17423 : * for i in range(ndim - 1, -1, -1):
17424 : */
17425 0 : __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
17426 :
17427 : /* "View.MemoryView":1343
17428 : * cdef int offset = ndim_other - ndim
17429 : *
17430 : * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17431 : * mslice.shape[i + offset] = mslice.shape[i]
17432 : * mslice.strides[i + offset] = mslice.strides[i]
17433 : */
17434 0 : for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17435 0 : __pyx_v_i = __pyx_t_1;
17436 :
17437 : /* "View.MemoryView":1344
17438 : *
17439 : * for i in range(ndim - 1, -1, -1):
17440 : * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
17441 : * mslice.strides[i + offset] = mslice.strides[i]
17442 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17443 : */
17444 0 : (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
17445 :
17446 : /* "View.MemoryView":1345
17447 : * for i in range(ndim - 1, -1, -1):
17448 : * mslice.shape[i + offset] = mslice.shape[i]
17449 : * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
17450 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17451 : *
17452 : */
17453 0 : (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
17454 :
17455 : /* "View.MemoryView":1346
17456 : * mslice.shape[i + offset] = mslice.shape[i]
17457 : * mslice.strides[i + offset] = mslice.strides[i]
17458 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
17459 : *
17460 : * for i in range(offset):
17461 : */
17462 0 : (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
17463 : }
17464 :
17465 : /* "View.MemoryView":1348
17466 : * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
17467 : *
17468 : * for i in range(offset): # <<<<<<<<<<<<<<
17469 : * mslice.shape[i] = 1
17470 : * mslice.strides[i] = mslice.strides[0]
17471 : */
17472 0 : __pyx_t_1 = __pyx_v_offset;
17473 : __pyx_t_2 = __pyx_t_1;
17474 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17475 0 : __pyx_v_i = __pyx_t_3;
17476 :
17477 : /* "View.MemoryView":1349
17478 : *
17479 : * for i in range(offset):
17480 : * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
17481 : * mslice.strides[i] = mslice.strides[0]
17482 : * mslice.suboffsets[i] = -1
17483 : */
17484 0 : (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
17485 :
17486 : /* "View.MemoryView":1350
17487 : * for i in range(offset):
17488 : * mslice.shape[i] = 1
17489 : * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
17490 : * mslice.suboffsets[i] = -1
17491 : *
17492 : */
17493 0 : (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
17494 :
17495 : /* "View.MemoryView":1351
17496 : * mslice.shape[i] = 1
17497 : * mslice.strides[i] = mslice.strides[0]
17498 : * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
17499 : *
17500 : *
17501 : */
17502 0 : (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
17503 : }
17504 :
17505 : /* "View.MemoryView":1337
17506 : *
17507 : * @cname('__pyx_memoryview_broadcast_leading')
17508 : * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
17509 : * int ndim,
17510 : * int ndim_other) noexcept nogil:
17511 : */
17512 :
17513 : /* function exit code */
17514 0 : }
17515 :
17516 : /* "View.MemoryView":1359
17517 : *
17518 : * @cname('__pyx_memoryview_refcount_copying')
17519 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
17520 : *
17521 : * if dtype_is_object:
17522 : */
17523 :
17524 0 : static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
17525 :
17526 : /* "View.MemoryView":1361
17527 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17528 : *
17529 : * if dtype_is_object: # <<<<<<<<<<<<<<
17530 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17531 : *
17532 : */
17533 0 : if (__pyx_v_dtype_is_object) {
17534 :
17535 : /* "View.MemoryView":1362
17536 : *
17537 : * if dtype_is_object:
17538 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc) # <<<<<<<<<<<<<<
17539 : *
17540 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17541 : */
17542 0 : __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
17543 :
17544 : /* "View.MemoryView":1361
17545 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil:
17546 : *
17547 : * if dtype_is_object: # <<<<<<<<<<<<<<
17548 : * refcount_objects_in_slice_with_gil(dst.data, dst.shape, dst.strides, ndim, inc)
17549 : *
17550 : */
17551 : }
17552 :
17553 : /* "View.MemoryView":1359
17554 : *
17555 : * @cname('__pyx_memoryview_refcount_copying')
17556 : * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, int ndim, bint inc) noexcept nogil: # <<<<<<<<<<<<<<
17557 : *
17558 : * if dtype_is_object:
17559 : */
17560 :
17561 : /* function exit code */
17562 0 : }
17563 :
17564 : /* "View.MemoryView":1365
17565 : *
17566 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17567 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17568 : * Py_ssize_t *strides, int ndim,
17569 : * bint inc) noexcept with gil:
17570 : */
17571 :
17572 0 : static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17573 : #ifdef WITH_THREAD
17574 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
17575 : #endif
17576 :
17577 : /* "View.MemoryView":1368
17578 : * Py_ssize_t *strides, int ndim,
17579 : * bint inc) noexcept with gil:
17580 : * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
17581 : *
17582 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17583 : */
17584 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
17585 :
17586 : /* "View.MemoryView":1365
17587 : *
17588 : * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
17589 : * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17590 : * Py_ssize_t *strides, int ndim,
17591 : * bint inc) noexcept with gil:
17592 : */
17593 :
17594 : /* function exit code */
17595 : #ifdef WITH_THREAD
17596 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
17597 : #endif
17598 0 : }
17599 :
17600 : /* "View.MemoryView":1371
17601 : *
17602 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17603 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17604 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17605 : * cdef Py_ssize_t i
17606 : */
17607 :
17608 0 : static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
17609 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17610 0 : Py_ssize_t __pyx_v_stride;
17611 0 : Py_ssize_t __pyx_t_1;
17612 0 : Py_ssize_t __pyx_t_2;
17613 0 : Py_ssize_t __pyx_t_3;
17614 0 : int __pyx_t_4;
17615 :
17616 : /* "View.MemoryView":1374
17617 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17618 : * cdef Py_ssize_t i
17619 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17620 : *
17621 : * for i in range(shape[0]):
17622 : */
17623 0 : __pyx_v_stride = (__pyx_v_strides[0]);
17624 :
17625 : /* "View.MemoryView":1376
17626 : * cdef Py_ssize_t stride = strides[0]
17627 : *
17628 : * for i in range(shape[0]): # <<<<<<<<<<<<<<
17629 : * if ndim == 1:
17630 : * if inc:
17631 : */
17632 0 : __pyx_t_1 = (__pyx_v_shape[0]);
17633 0 : __pyx_t_2 = __pyx_t_1;
17634 0 : for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17635 0 : __pyx_v_i = __pyx_t_3;
17636 :
17637 : /* "View.MemoryView":1377
17638 : *
17639 : * for i in range(shape[0]):
17640 : * if ndim == 1: # <<<<<<<<<<<<<<
17641 : * if inc:
17642 : * Py_INCREF((<PyObject **> data)[0])
17643 : */
17644 0 : __pyx_t_4 = (__pyx_v_ndim == 1);
17645 0 : if (__pyx_t_4) {
17646 :
17647 : /* "View.MemoryView":1378
17648 : * for i in range(shape[0]):
17649 : * if ndim == 1:
17650 : * if inc: # <<<<<<<<<<<<<<
17651 : * Py_INCREF((<PyObject **> data)[0])
17652 : * else:
17653 : */
17654 0 : if (__pyx_v_inc) {
17655 :
17656 : /* "View.MemoryView":1379
17657 : * if ndim == 1:
17658 : * if inc:
17659 : * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17660 : * else:
17661 : * Py_DECREF((<PyObject **> data)[0])
17662 : */
17663 0 : Py_INCREF((((PyObject **)__pyx_v_data)[0]));
17664 :
17665 : /* "View.MemoryView":1378
17666 : * for i in range(shape[0]):
17667 : * if ndim == 1:
17668 : * if inc: # <<<<<<<<<<<<<<
17669 : * Py_INCREF((<PyObject **> data)[0])
17670 : * else:
17671 : */
17672 0 : goto __pyx_L6;
17673 : }
17674 :
17675 : /* "View.MemoryView":1381
17676 : * Py_INCREF((<PyObject **> data)[0])
17677 : * else:
17678 : * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
17679 : * else:
17680 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17681 : */
17682 : /*else*/ {
17683 0 : Py_DECREF((((PyObject **)__pyx_v_data)[0]));
17684 : }
17685 0 : __pyx_L6:;
17686 :
17687 : /* "View.MemoryView":1377
17688 : *
17689 : * for i in range(shape[0]):
17690 : * if ndim == 1: # <<<<<<<<<<<<<<
17691 : * if inc:
17692 : * Py_INCREF((<PyObject **> data)[0])
17693 : */
17694 0 : goto __pyx_L5;
17695 : }
17696 :
17697 : /* "View.MemoryView":1383
17698 : * Py_DECREF((<PyObject **> data)[0])
17699 : * else:
17700 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc) # <<<<<<<<<<<<<<
17701 : *
17702 : * data += stride
17703 : */
17704 : /*else*/ {
17705 0 : __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
17706 : }
17707 0 : __pyx_L5:;
17708 :
17709 : /* "View.MemoryView":1385
17710 : * refcount_objects_in_slice(data, shape + 1, strides + 1, ndim - 1, inc)
17711 : *
17712 : * data += stride # <<<<<<<<<<<<<<
17713 : *
17714 : *
17715 : */
17716 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17717 : }
17718 :
17719 : /* "View.MemoryView":1371
17720 : *
17721 : * @cname('__pyx_memoryview_refcount_objects_in_slice')
17722 : * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17723 : * Py_ssize_t *strides, int ndim, bint inc) noexcept:
17724 : * cdef Py_ssize_t i
17725 : */
17726 :
17727 : /* function exit code */
17728 0 : }
17729 :
17730 : /* "View.MemoryView":1391
17731 : *
17732 : * @cname('__pyx_memoryview_slice_assign_scalar')
17733 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17734 : * size_t itemsize, void *item,
17735 : * bint dtype_is_object) noexcept nogil:
17736 : */
17737 :
17738 0 : static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
17739 :
17740 : /* "View.MemoryView":1394
17741 : * size_t itemsize, void *item,
17742 : * bint dtype_is_object) noexcept nogil:
17743 : * refcount_copying(dst, dtype_is_object, ndim, inc=False) # <<<<<<<<<<<<<<
17744 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
17745 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
17746 : */
17747 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
17748 :
17749 : /* "View.MemoryView":1395
17750 : * bint dtype_is_object) noexcept nogil:
17751 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
17752 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item) # <<<<<<<<<<<<<<
17753 : * refcount_copying(dst, dtype_is_object, ndim, inc=True)
17754 : *
17755 : */
17756 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
17757 :
17758 : /* "View.MemoryView":1396
17759 : * refcount_copying(dst, dtype_is_object, ndim, inc=False)
17760 : * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, itemsize, item)
17761 : * refcount_copying(dst, dtype_is_object, ndim, inc=True) # <<<<<<<<<<<<<<
17762 : *
17763 : *
17764 : */
17765 0 : __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
17766 :
17767 : /* "View.MemoryView":1391
17768 : *
17769 : * @cname('__pyx_memoryview_slice_assign_scalar')
17770 : * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
17771 : * size_t itemsize, void *item,
17772 : * bint dtype_is_object) noexcept nogil:
17773 : */
17774 :
17775 : /* function exit code */
17776 0 : }
17777 :
17778 : /* "View.MemoryView":1400
17779 : *
17780 : * @cname('__pyx_memoryview__slice_assign_scalar')
17781 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17782 : * Py_ssize_t *strides, int ndim,
17783 : * size_t itemsize, void *item) noexcept nogil:
17784 : */
17785 :
17786 0 : static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
17787 0 : CYTHON_UNUSED Py_ssize_t __pyx_v_i;
17788 0 : Py_ssize_t __pyx_v_stride;
17789 0 : Py_ssize_t __pyx_v_extent;
17790 0 : int __pyx_t_1;
17791 0 : Py_ssize_t __pyx_t_2;
17792 0 : Py_ssize_t __pyx_t_3;
17793 0 : Py_ssize_t __pyx_t_4;
17794 :
17795 : /* "View.MemoryView":1404
17796 : * size_t itemsize, void *item) noexcept nogil:
17797 : * cdef Py_ssize_t i
17798 : * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
17799 : * cdef Py_ssize_t extent = shape[0]
17800 : *
17801 : */
17802 0 : __pyx_v_stride = (__pyx_v_strides[0]);
17803 :
17804 : /* "View.MemoryView":1405
17805 : * cdef Py_ssize_t i
17806 : * cdef Py_ssize_t stride = strides[0]
17807 : * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
17808 : *
17809 : * if ndim == 1:
17810 : */
17811 0 : __pyx_v_extent = (__pyx_v_shape[0]);
17812 :
17813 : /* "View.MemoryView":1407
17814 : * cdef Py_ssize_t extent = shape[0]
17815 : *
17816 : * if ndim == 1: # <<<<<<<<<<<<<<
17817 : * for i in range(extent):
17818 : * memcpy(data, item, itemsize)
17819 : */
17820 0 : __pyx_t_1 = (__pyx_v_ndim == 1);
17821 0 : if (__pyx_t_1) {
17822 :
17823 : /* "View.MemoryView":1408
17824 : *
17825 : * if ndim == 1:
17826 : * for i in range(extent): # <<<<<<<<<<<<<<
17827 : * memcpy(data, item, itemsize)
17828 : * data += stride
17829 : */
17830 : __pyx_t_2 = __pyx_v_extent;
17831 : __pyx_t_3 = __pyx_t_2;
17832 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17833 0 : __pyx_v_i = __pyx_t_4;
17834 :
17835 : /* "View.MemoryView":1409
17836 : * if ndim == 1:
17837 : * for i in range(extent):
17838 : * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
17839 : * data += stride
17840 : * else:
17841 : */
17842 0 : (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
17843 :
17844 : /* "View.MemoryView":1410
17845 : * for i in range(extent):
17846 : * memcpy(data, item, itemsize)
17847 : * data += stride # <<<<<<<<<<<<<<
17848 : * else:
17849 : * for i in range(extent):
17850 : */
17851 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17852 : }
17853 :
17854 : /* "View.MemoryView":1407
17855 : * cdef Py_ssize_t extent = shape[0]
17856 : *
17857 : * if ndim == 1: # <<<<<<<<<<<<<<
17858 : * for i in range(extent):
17859 : * memcpy(data, item, itemsize)
17860 : */
17861 0 : goto __pyx_L3;
17862 : }
17863 :
17864 : /* "View.MemoryView":1412
17865 : * data += stride
17866 : * else:
17867 : * for i in range(extent): # <<<<<<<<<<<<<<
17868 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
17869 : * data += stride
17870 : */
17871 : /*else*/ {
17872 : __pyx_t_2 = __pyx_v_extent;
17873 : __pyx_t_3 = __pyx_t_2;
17874 0 : for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17875 0 : __pyx_v_i = __pyx_t_4;
17876 :
17877 : /* "View.MemoryView":1413
17878 : * else:
17879 : * for i in range(extent):
17880 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
17881 : * data += stride
17882 : *
17883 : */
17884 0 : __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
17885 :
17886 : /* "View.MemoryView":1414
17887 : * for i in range(extent):
17888 : * _slice_assign_scalar(data, shape + 1, strides + 1, ndim - 1, itemsize, item)
17889 : * data += stride # <<<<<<<<<<<<<<
17890 : *
17891 : *
17892 : */
17893 0 : __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
17894 : }
17895 : }
17896 0 : __pyx_L3:;
17897 :
17898 : /* "View.MemoryView":1400
17899 : *
17900 : * @cname('__pyx_memoryview__slice_assign_scalar')
17901 : * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
17902 : * Py_ssize_t *strides, int ndim,
17903 : * size_t itemsize, void *item) noexcept nogil:
17904 : */
17905 :
17906 : /* function exit code */
17907 0 : }
17908 :
17909 : /* "(tree fragment)":1
17910 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
17911 : * cdef object __pyx_PickleError
17912 : * cdef object __pyx_result
17913 : */
17914 :
17915 : /* Python wrapper */
17916 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
17917 : #if CYTHON_METH_FASTCALL
17918 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
17919 : #else
17920 : PyObject *__pyx_args, PyObject *__pyx_kwds
17921 : #endif
17922 : ); /*proto*/
17923 : static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
17924 0 : static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self,
17925 : #if CYTHON_METH_FASTCALL
17926 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
17927 : #else
17928 : PyObject *__pyx_args, PyObject *__pyx_kwds
17929 : #endif
17930 : ) {
17931 0 : PyObject *__pyx_v___pyx_type = 0;
17932 0 : long __pyx_v___pyx_checksum;
17933 0 : PyObject *__pyx_v___pyx_state = 0;
17934 : #if !CYTHON_METH_FASTCALL
17935 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
17936 : #endif
17937 0 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
17938 0 : PyObject* values[3] = {0,0,0};
17939 0 : int __pyx_lineno = 0;
17940 0 : const char *__pyx_filename = NULL;
17941 0 : int __pyx_clineno = 0;
17942 0 : PyObject *__pyx_r = 0;
17943 : __Pyx_RefNannyDeclarations
17944 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
17945 : #if !CYTHON_METH_FASTCALL
17946 : #if CYTHON_ASSUME_SAFE_MACROS
17947 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
17948 : #else
17949 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
17950 : #endif
17951 : #endif
17952 0 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
17953 : {
17954 0 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
17955 0 : if (__pyx_kwds) {
17956 0 : Py_ssize_t kw_args;
17957 0 : switch (__pyx_nargs) {
17958 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
17959 0 : CYTHON_FALLTHROUGH;
17960 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
17961 0 : CYTHON_FALLTHROUGH;
17962 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
17963 0 : CYTHON_FALLTHROUGH;
17964 0 : case 0: break;
17965 0 : default: goto __pyx_L5_argtuple_error;
17966 : }
17967 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
17968 0 : switch (__pyx_nargs) {
17969 0 : case 0:
17970 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) {
17971 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
17972 0 : kw_args--;
17973 : }
17974 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17975 0 : else goto __pyx_L5_argtuple_error;
17976 0 : CYTHON_FALLTHROUGH;
17977 : case 1:
17978 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) {
17979 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
17980 0 : kw_args--;
17981 : }
17982 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17983 : else {
17984 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
17985 : }
17986 0 : CYTHON_FALLTHROUGH;
17987 : case 2:
17988 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
17989 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
17990 0 : kw_args--;
17991 : }
17992 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
17993 : else {
17994 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
17995 : }
17996 : }
17997 0 : if (unlikely(kw_args > 0)) {
17998 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
17999 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
18000 : }
18001 0 : } else if (unlikely(__pyx_nargs != 3)) {
18002 0 : goto __pyx_L5_argtuple_error;
18003 : } else {
18004 0 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
18005 0 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
18006 0 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
18007 : }
18008 0 : __pyx_v___pyx_type = values[0];
18009 0 : __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
18010 0 : __pyx_v___pyx_state = values[2];
18011 : }
18012 0 : goto __pyx_L6_skip;
18013 0 : __pyx_L5_argtuple_error:;
18014 0 : __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
18015 0 : __pyx_L6_skip:;
18016 0 : goto __pyx_L4_argument_unpacking_done;
18017 0 : __pyx_L3_error:;
18018 : {
18019 0 : Py_ssize_t __pyx_temp;
18020 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18021 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18022 : }
18023 : }
18024 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18025 0 : __Pyx_RefNannyFinishContext();
18026 0 : return NULL;
18027 0 : __pyx_L4_argument_unpacking_done:;
18028 0 : __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
18029 :
18030 : /* function exit code */
18031 : {
18032 0 : Py_ssize_t __pyx_temp;
18033 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
18034 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
18035 : }
18036 : }
18037 : __Pyx_RefNannyFinishContext();
18038 : return __pyx_r;
18039 : }
18040 :
18041 0 : static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
18042 0 : PyObject *__pyx_v___pyx_PickleError = 0;
18043 0 : PyObject *__pyx_v___pyx_result = 0;
18044 0 : PyObject *__pyx_r = NULL;
18045 : __Pyx_RefNannyDeclarations
18046 0 : PyObject *__pyx_t_1 = NULL;
18047 0 : int __pyx_t_2;
18048 0 : PyObject *__pyx_t_3 = NULL;
18049 0 : PyObject *__pyx_t_4 = NULL;
18050 0 : unsigned int __pyx_t_5;
18051 0 : int __pyx_lineno = 0;
18052 0 : const char *__pyx_filename = NULL;
18053 0 : int __pyx_clineno = 0;
18054 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 1);
18055 :
18056 : /* "(tree fragment)":4
18057 : * cdef object __pyx_PickleError
18058 : * cdef object __pyx_result
18059 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18060 : * from pickle import PickleError as __pyx_PickleError
18061 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18062 : */
18063 0 : __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
18064 0 : __Pyx_GOTREF(__pyx_t_1);
18065 0 : __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__8, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(1, 4, __pyx_L1_error)
18066 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18067 0 : if (__pyx_t_2) {
18068 :
18069 : /* "(tree fragment)":5
18070 : * cdef object __pyx_result
18071 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18072 : * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
18073 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18074 : * __pyx_result = Enum.__new__(__pyx_type)
18075 : */
18076 0 : __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18077 0 : __Pyx_GOTREF(__pyx_t_1);
18078 0 : __Pyx_INCREF(__pyx_n_s_PickleError);
18079 0 : __Pyx_GIVEREF(__pyx_n_s_PickleError);
18080 0 : if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError)) __PYX_ERR(1, 5, __pyx_L1_error);
18081 0 : __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
18082 0 : __Pyx_GOTREF(__pyx_t_3);
18083 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18084 0 : __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
18085 0 : __Pyx_GOTREF(__pyx_t_1);
18086 0 : __Pyx_INCREF(__pyx_t_1);
18087 0 : __pyx_v___pyx_PickleError = __pyx_t_1;
18088 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18089 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18090 :
18091 : /* "(tree fragment)":6
18092 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931):
18093 : * from pickle import PickleError as __pyx_PickleError
18094 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum # <<<<<<<<<<<<<<
18095 : * __pyx_result = Enum.__new__(__pyx_type)
18096 : * if __pyx_state is not None:
18097 : */
18098 0 : __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
18099 0 : __Pyx_GOTREF(__pyx_t_3);
18100 0 : __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
18101 0 : __Pyx_GOTREF(__pyx_t_1);
18102 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18103 0 : __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_1, 0, 0);
18104 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18105 0 : __PYX_ERR(1, 6, __pyx_L1_error)
18106 :
18107 : /* "(tree fragment)":4
18108 : * cdef object __pyx_PickleError
18109 : * cdef object __pyx_result
18110 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
18111 : * from pickle import PickleError as __pyx_PickleError
18112 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18113 : */
18114 : }
18115 :
18116 : /* "(tree fragment)":7
18117 : * from pickle import PickleError as __pyx_PickleError
18118 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18119 : * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
18120 : * if __pyx_state is not None:
18121 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18122 : */
18123 0 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
18124 0 : __Pyx_GOTREF(__pyx_t_3);
18125 0 : __pyx_t_4 = NULL;
18126 0 : __pyx_t_5 = 0;
18127 : #if CYTHON_UNPACK_METHODS
18128 0 : if (likely(PyMethod_Check(__pyx_t_3))) {
18129 0 : __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
18130 0 : if (likely(__pyx_t_4)) {
18131 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
18132 0 : __Pyx_INCREF(__pyx_t_4);
18133 0 : __Pyx_INCREF(function);
18134 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
18135 : __pyx_t_5 = 1;
18136 : }
18137 : }
18138 : #endif
18139 : {
18140 0 : PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
18141 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
18142 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
18143 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
18144 0 : __Pyx_GOTREF(__pyx_t_1);
18145 0 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18146 : }
18147 0 : __pyx_v___pyx_result = __pyx_t_1;
18148 0 : __pyx_t_1 = 0;
18149 :
18150 : /* "(tree fragment)":8
18151 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18152 : * __pyx_result = Enum.__new__(__pyx_type)
18153 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18154 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18155 : * return __pyx_result
18156 : */
18157 0 : __pyx_t_2 = (__pyx_v___pyx_state != Py_None);
18158 0 : if (__pyx_t_2) {
18159 :
18160 : /* "(tree fragment)":9
18161 : * __pyx_result = Enum.__new__(__pyx_type)
18162 : * if __pyx_state is not None:
18163 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
18164 : * return __pyx_result
18165 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18166 : */
18167 0 : if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
18168 0 : __pyx_t_1 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
18169 0 : __Pyx_GOTREF(__pyx_t_1);
18170 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18171 :
18172 : /* "(tree fragment)":8
18173 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
18174 : * __pyx_result = Enum.__new__(__pyx_type)
18175 : * if __pyx_state is not None: # <<<<<<<<<<<<<<
18176 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18177 : * return __pyx_result
18178 : */
18179 : }
18180 :
18181 : /* "(tree fragment)":10
18182 : * if __pyx_state is not None:
18183 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18184 : * return __pyx_result # <<<<<<<<<<<<<<
18185 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18186 : * __pyx_result.name = __pyx_state[0]
18187 : */
18188 0 : __Pyx_XDECREF(__pyx_r);
18189 0 : __Pyx_INCREF(__pyx_v___pyx_result);
18190 0 : __pyx_r = __pyx_v___pyx_result;
18191 0 : goto __pyx_L0;
18192 :
18193 : /* "(tree fragment)":1
18194 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
18195 : * cdef object __pyx_PickleError
18196 : * cdef object __pyx_result
18197 : */
18198 :
18199 : /* function exit code */
18200 0 : __pyx_L1_error:;
18201 0 : __Pyx_XDECREF(__pyx_t_1);
18202 0 : __Pyx_XDECREF(__pyx_t_3);
18203 0 : __Pyx_XDECREF(__pyx_t_4);
18204 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
18205 0 : __pyx_r = NULL;
18206 0 : __pyx_L0:;
18207 0 : __Pyx_XDECREF(__pyx_v___pyx_PickleError);
18208 0 : __Pyx_XDECREF(__pyx_v___pyx_result);
18209 0 : __Pyx_XGIVEREF(__pyx_r);
18210 0 : __Pyx_RefNannyFinishContext();
18211 0 : return __pyx_r;
18212 : }
18213 :
18214 : /* "(tree fragment)":11
18215 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18216 : * return __pyx_result
18217 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18218 : * __pyx_result.name = __pyx_state[0]
18219 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18220 : */
18221 :
18222 0 : static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
18223 0 : PyObject *__pyx_r = NULL;
18224 : __Pyx_RefNannyDeclarations
18225 0 : PyObject *__pyx_t_1 = NULL;
18226 0 : int __pyx_t_2;
18227 0 : Py_ssize_t __pyx_t_3;
18228 0 : int __pyx_t_4;
18229 0 : PyObject *__pyx_t_5 = NULL;
18230 0 : PyObject *__pyx_t_6 = NULL;
18231 0 : PyObject *__pyx_t_7 = NULL;
18232 0 : unsigned int __pyx_t_8;
18233 0 : int __pyx_lineno = 0;
18234 0 : const char *__pyx_filename = NULL;
18235 0 : int __pyx_clineno = 0;
18236 0 : __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 1);
18237 :
18238 : /* "(tree fragment)":12
18239 : * return __pyx_result
18240 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18241 : * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
18242 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18243 : * __pyx_result.__dict__.update(__pyx_state[1])
18244 : */
18245 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18246 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18247 0 : __PYX_ERR(1, 12, __pyx_L1_error)
18248 : }
18249 0 : __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
18250 0 : __Pyx_GOTREF(__pyx_t_1);
18251 0 : __Pyx_GIVEREF(__pyx_t_1);
18252 0 : __Pyx_GOTREF(__pyx_v___pyx_result->name);
18253 0 : __Pyx_DECREF(__pyx_v___pyx_result->name);
18254 0 : __pyx_v___pyx_result->name = __pyx_t_1;
18255 0 : __pyx_t_1 = 0;
18256 :
18257 : /* "(tree fragment)":13
18258 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18259 : * __pyx_result.name = __pyx_state[0]
18260 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
18261 : * __pyx_result.__dict__.update(__pyx_state[1])
18262 : */
18263 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18264 : PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
18265 : __PYX_ERR(1, 13, __pyx_L1_error)
18266 : }
18267 0 : __pyx_t_3 = __Pyx_PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18268 0 : __pyx_t_4 = (__pyx_t_3 > 1);
18269 0 : if (__pyx_t_4) {
18270 0 : } else {
18271 0 : __pyx_t_2 = __pyx_t_4;
18272 0 : goto __pyx_L4_bool_binop_done;
18273 : }
18274 0 : __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
18275 : __pyx_t_2 = __pyx_t_4;
18276 0 : __pyx_L4_bool_binop_done:;
18277 0 : if (__pyx_t_2) {
18278 :
18279 : /* "(tree fragment)":14
18280 : * __pyx_result.name = __pyx_state[0]
18281 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18282 : * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
18283 : */
18284 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
18285 0 : __Pyx_GOTREF(__pyx_t_5);
18286 0 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_update); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
18287 0 : __Pyx_GOTREF(__pyx_t_6);
18288 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18289 0 : if (unlikely(__pyx_v___pyx_state == Py_None)) {
18290 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18291 : __PYX_ERR(1, 14, __pyx_L1_error)
18292 : }
18293 0 : __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 14, __pyx_L1_error)
18294 0 : __Pyx_GOTREF(__pyx_t_5);
18295 0 : __pyx_t_7 = NULL;
18296 0 : __pyx_t_8 = 0;
18297 : #if CYTHON_UNPACK_METHODS
18298 0 : if (likely(PyMethod_Check(__pyx_t_6))) {
18299 0 : __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
18300 0 : if (likely(__pyx_t_7)) {
18301 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
18302 0 : __Pyx_INCREF(__pyx_t_7);
18303 0 : __Pyx_INCREF(function);
18304 0 : __Pyx_DECREF_SET(__pyx_t_6, function);
18305 : __pyx_t_8 = 1;
18306 : }
18307 : }
18308 : #endif
18309 : {
18310 0 : PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_5};
18311 0 : __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
18312 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
18313 0 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
18314 0 : if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
18315 0 : __Pyx_GOTREF(__pyx_t_1);
18316 0 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18317 : }
18318 0 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18319 :
18320 : /* "(tree fragment)":13
18321 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
18322 : * __pyx_result.name = __pyx_state[0]
18323 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
18324 : * __pyx_result.__dict__.update(__pyx_state[1])
18325 : */
18326 : }
18327 :
18328 : /* "(tree fragment)":11
18329 : * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
18330 : * return __pyx_result
18331 : * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
18332 : * __pyx_result.name = __pyx_state[0]
18333 : * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
18334 : */
18335 :
18336 : /* function exit code */
18337 0 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18338 0 : goto __pyx_L0;
18339 0 : __pyx_L1_error:;
18340 0 : __Pyx_XDECREF(__pyx_t_1);
18341 0 : __Pyx_XDECREF(__pyx_t_5);
18342 0 : __Pyx_XDECREF(__pyx_t_6);
18343 0 : __Pyx_XDECREF(__pyx_t_7);
18344 0 : __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
18345 0 : __pyx_r = 0;
18346 0 : __pyx_L0:;
18347 0 : __Pyx_XGIVEREF(__pyx_r);
18348 0 : __Pyx_RefNannyFinishContext();
18349 0 : return __pyx_r;
18350 : }
18351 :
18352 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
18353 : *
18354 : * @property
18355 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
18356 : * return PyDataType_ELSIZE(self)
18357 : *
18358 : */
18359 :
18360 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_8itemsize_itemsize(PyArray_Descr *__pyx_v_self) {
18361 : npy_intp __pyx_r;
18362 :
18363 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":287
18364 : * @property
18365 : * cdef inline npy_intp itemsize(self) noexcept nogil:
18366 : * return PyDataType_ELSIZE(self) # <<<<<<<<<<<<<<
18367 : *
18368 : * @property
18369 : */
18370 : __pyx_r = PyDataType_ELSIZE(__pyx_v_self);
18371 : goto __pyx_L0;
18372 :
18373 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":286
18374 : *
18375 : * @property
18376 : * cdef inline npy_intp itemsize(self) noexcept nogil: # <<<<<<<<<<<<<<
18377 : * return PyDataType_ELSIZE(self)
18378 : *
18379 : */
18380 :
18381 : /* function exit code */
18382 : __pyx_L0:;
18383 : return __pyx_r;
18384 : }
18385 :
18386 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
18387 : *
18388 : * @property
18389 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
18390 : * return PyDataType_ALIGNMENT(self)
18391 : *
18392 : */
18393 :
18394 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_5dtype_9alignment_alignment(PyArray_Descr *__pyx_v_self) {
18395 : npy_intp __pyx_r;
18396 :
18397 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":291
18398 : * @property
18399 : * cdef inline npy_intp alignment(self) noexcept nogil:
18400 : * return PyDataType_ALIGNMENT(self) # <<<<<<<<<<<<<<
18401 : *
18402 : * # Use fields/names with care as they may be NULL. You must check
18403 : */
18404 : __pyx_r = PyDataType_ALIGNMENT(__pyx_v_self);
18405 : goto __pyx_L0;
18406 :
18407 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":290
18408 : *
18409 : * @property
18410 : * cdef inline npy_intp alignment(self) noexcept nogil: # <<<<<<<<<<<<<<
18411 : * return PyDataType_ALIGNMENT(self)
18412 : *
18413 : */
18414 :
18415 : /* function exit code */
18416 : __pyx_L0:;
18417 : return __pyx_r;
18418 : }
18419 :
18420 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
18421 : * # for this using PyDataType_HASFIELDS.
18422 : * @property
18423 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
18424 : * return <object>PyDataType_FIELDS(self)
18425 : *
18426 : */
18427 :
18428 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_6fields_fields(PyArray_Descr *__pyx_v_self) {
18429 : PyObject *__pyx_r = NULL;
18430 : __Pyx_RefNannyDeclarations
18431 : PyObject *__pyx_t_1;
18432 : __Pyx_RefNannySetupContext("fields", 1);
18433 :
18434 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":297
18435 : * @property
18436 : * cdef inline object fields(self):
18437 : * return <object>PyDataType_FIELDS(self) # <<<<<<<<<<<<<<
18438 : *
18439 : * @property
18440 : */
18441 : __Pyx_XDECREF(__pyx_r);
18442 : __pyx_t_1 = PyDataType_FIELDS(__pyx_v_self);
18443 : __Pyx_INCREF(((PyObject *)__pyx_t_1));
18444 : __pyx_r = ((PyObject *)__pyx_t_1);
18445 : goto __pyx_L0;
18446 :
18447 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":296
18448 : * # for this using PyDataType_HASFIELDS.
18449 : * @property
18450 : * cdef inline object fields(self): # <<<<<<<<<<<<<<
18451 : * return <object>PyDataType_FIELDS(self)
18452 : *
18453 : */
18454 :
18455 : /* function exit code */
18456 : __pyx_L0:;
18457 : __Pyx_XGIVEREF(__pyx_r);
18458 : __Pyx_RefNannyFinishContext();
18459 : return __pyx_r;
18460 : }
18461 :
18462 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
18463 : *
18464 : * @property
18465 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
18466 : * return <tuple>PyDataType_NAMES(self)
18467 : *
18468 : */
18469 :
18470 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_5dtype_5names_names(PyArray_Descr *__pyx_v_self) {
18471 : PyObject *__pyx_r = NULL;
18472 : __Pyx_RefNannyDeclarations
18473 : PyObject *__pyx_t_1;
18474 : __Pyx_RefNannySetupContext("names", 1);
18475 :
18476 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":301
18477 : * @property
18478 : * cdef inline tuple names(self):
18479 : * return <tuple>PyDataType_NAMES(self) # <<<<<<<<<<<<<<
18480 : *
18481 : * # Use PyDataType_HASSUBARRAY to test whether this field is
18482 : */
18483 : __Pyx_XDECREF(__pyx_r);
18484 : __pyx_t_1 = PyDataType_NAMES(__pyx_v_self);
18485 : __Pyx_INCREF(((PyObject*)__pyx_t_1));
18486 : __pyx_r = ((PyObject*)__pyx_t_1);
18487 : goto __pyx_L0;
18488 :
18489 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":300
18490 : *
18491 : * @property
18492 : * cdef inline tuple names(self): # <<<<<<<<<<<<<<
18493 : * return <tuple>PyDataType_NAMES(self)
18494 : *
18495 : */
18496 :
18497 : /* function exit code */
18498 : __pyx_L0:;
18499 : __Pyx_XGIVEREF(__pyx_r);
18500 : __Pyx_RefNannyFinishContext();
18501 : return __pyx_r;
18502 : }
18503 :
18504 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
18505 : * # this field via the inline helper method PyDataType_SHAPE.
18506 : * @property
18507 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
18508 : * return PyDataType_SUBARRAY(self)
18509 : *
18510 : */
18511 :
18512 : static CYTHON_INLINE PyArray_ArrayDescr *__pyx_f_5numpy_5dtype_8subarray_subarray(PyArray_Descr *__pyx_v_self) {
18513 : PyArray_ArrayDescr *__pyx_r;
18514 :
18515 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":308
18516 : * @property
18517 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil:
18518 : * return PyDataType_SUBARRAY(self) # <<<<<<<<<<<<<<
18519 : *
18520 : * @property
18521 : */
18522 : __pyx_r = PyDataType_SUBARRAY(__pyx_v_self);
18523 : goto __pyx_L0;
18524 :
18525 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":307
18526 : * # this field via the inline helper method PyDataType_SHAPE.
18527 : * @property
18528 : * cdef inline PyArray_ArrayDescr* subarray(self) noexcept nogil: # <<<<<<<<<<<<<<
18529 : * return PyDataType_SUBARRAY(self)
18530 : *
18531 : */
18532 :
18533 : /* function exit code */
18534 : __pyx_L0:;
18535 : return __pyx_r;
18536 : }
18537 :
18538 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
18539 : *
18540 : * @property
18541 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
18542 : * """The data types flags."""
18543 : * return PyDataType_FLAGS(self)
18544 : */
18545 :
18546 : static CYTHON_INLINE npy_uint64 __pyx_f_5numpy_5dtype_5flags_flags(PyArray_Descr *__pyx_v_self) {
18547 : npy_uint64 __pyx_r;
18548 :
18549 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":313
18550 : * cdef inline npy_uint64 flags(self) noexcept nogil:
18551 : * """The data types flags."""
18552 : * return PyDataType_FLAGS(self) # <<<<<<<<<<<<<<
18553 : *
18554 : *
18555 : */
18556 : __pyx_r = PyDataType_FLAGS(__pyx_v_self);
18557 : goto __pyx_L0;
18558 :
18559 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":311
18560 : *
18561 : * @property
18562 : * cdef inline npy_uint64 flags(self) noexcept nogil: # <<<<<<<<<<<<<<
18563 : * """The data types flags."""
18564 : * return PyDataType_FLAGS(self)
18565 : */
18566 :
18567 : /* function exit code */
18568 : __pyx_L0:;
18569 : return __pyx_r;
18570 : }
18571 :
18572 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
18573 : *
18574 : * @property
18575 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
18576 : * """The number of arrays that need to be broadcast to the same shape."""
18577 : * return PyArray_MultiIter_NUMITER(self)
18578 : */
18579 :
18580 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_7numiter_numiter(PyArrayMultiIterObject *__pyx_v_self) {
18581 : int __pyx_r;
18582 :
18583 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":325
18584 : * cdef inline int numiter(self) noexcept nogil:
18585 : * """The number of arrays that need to be broadcast to the same shape."""
18586 : * return PyArray_MultiIter_NUMITER(self) # <<<<<<<<<<<<<<
18587 : *
18588 : * @property
18589 : */
18590 : __pyx_r = PyArray_MultiIter_NUMITER(__pyx_v_self);
18591 : goto __pyx_L0;
18592 :
18593 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":323
18594 : *
18595 : * @property
18596 : * cdef inline int numiter(self) noexcept nogil: # <<<<<<<<<<<<<<
18597 : * """The number of arrays that need to be broadcast to the same shape."""
18598 : * return PyArray_MultiIter_NUMITER(self)
18599 : */
18600 :
18601 : /* function exit code */
18602 : __pyx_L0:;
18603 : return __pyx_r;
18604 : }
18605 :
18606 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
18607 : *
18608 : * @property
18609 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18610 : * """The total broadcasted size."""
18611 : * return PyArray_MultiIter_SIZE(self)
18612 : */
18613 :
18614 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_4size_size(PyArrayMultiIterObject *__pyx_v_self) {
18615 : npy_intp __pyx_r;
18616 :
18617 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":330
18618 : * cdef inline npy_intp size(self) noexcept nogil:
18619 : * """The total broadcasted size."""
18620 : * return PyArray_MultiIter_SIZE(self) # <<<<<<<<<<<<<<
18621 : *
18622 : * @property
18623 : */
18624 : __pyx_r = PyArray_MultiIter_SIZE(__pyx_v_self);
18625 : goto __pyx_L0;
18626 :
18627 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":328
18628 : *
18629 : * @property
18630 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18631 : * """The total broadcasted size."""
18632 : * return PyArray_MultiIter_SIZE(self)
18633 : */
18634 :
18635 : /* function exit code */
18636 : __pyx_L0:;
18637 : return __pyx_r;
18638 : }
18639 :
18640 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
18641 : *
18642 : * @property
18643 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
18644 : * """The current (1-d) index into the broadcasted result."""
18645 : * return PyArray_MultiIter_INDEX(self)
18646 : */
18647 :
18648 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_9broadcast_5index_index(PyArrayMultiIterObject *__pyx_v_self) {
18649 : npy_intp __pyx_r;
18650 :
18651 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":335
18652 : * cdef inline npy_intp index(self) noexcept nogil:
18653 : * """The current (1-d) index into the broadcasted result."""
18654 : * return PyArray_MultiIter_INDEX(self) # <<<<<<<<<<<<<<
18655 : *
18656 : * @property
18657 : */
18658 : __pyx_r = PyArray_MultiIter_INDEX(__pyx_v_self);
18659 : goto __pyx_L0;
18660 :
18661 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":333
18662 : *
18663 : * @property
18664 : * cdef inline npy_intp index(self) noexcept nogil: # <<<<<<<<<<<<<<
18665 : * """The current (1-d) index into the broadcasted result."""
18666 : * return PyArray_MultiIter_INDEX(self)
18667 : */
18668 :
18669 : /* function exit code */
18670 : __pyx_L0:;
18671 : return __pyx_r;
18672 : }
18673 :
18674 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
18675 : *
18676 : * @property
18677 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
18678 : * """The number of dimensions in the broadcasted result."""
18679 : * return PyArray_MultiIter_NDIM(self)
18680 : */
18681 :
18682 : static CYTHON_INLINE int __pyx_f_5numpy_9broadcast_2nd_nd(PyArrayMultiIterObject *__pyx_v_self) {
18683 : int __pyx_r;
18684 :
18685 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":340
18686 : * cdef inline int nd(self) noexcept nogil:
18687 : * """The number of dimensions in the broadcasted result."""
18688 : * return PyArray_MultiIter_NDIM(self) # <<<<<<<<<<<<<<
18689 : *
18690 : * @property
18691 : */
18692 : __pyx_r = PyArray_MultiIter_NDIM(__pyx_v_self);
18693 : goto __pyx_L0;
18694 :
18695 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":338
18696 : *
18697 : * @property
18698 : * cdef inline int nd(self) noexcept nogil: # <<<<<<<<<<<<<<
18699 : * """The number of dimensions in the broadcasted result."""
18700 : * return PyArray_MultiIter_NDIM(self)
18701 : */
18702 :
18703 : /* function exit code */
18704 : __pyx_L0:;
18705 : return __pyx_r;
18706 : }
18707 :
18708 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
18709 : *
18710 : * @property
18711 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
18712 : * """The shape of the broadcasted result."""
18713 : * return PyArray_MultiIter_DIMS(self)
18714 : */
18715 :
18716 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_9broadcast_10dimensions_dimensions(PyArrayMultiIterObject *__pyx_v_self) {
18717 : npy_intp *__pyx_r;
18718 :
18719 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":345
18720 : * cdef inline npy_intp* dimensions(self) noexcept nogil:
18721 : * """The shape of the broadcasted result."""
18722 : * return PyArray_MultiIter_DIMS(self) # <<<<<<<<<<<<<<
18723 : *
18724 : * @property
18725 : */
18726 : __pyx_r = PyArray_MultiIter_DIMS(__pyx_v_self);
18727 : goto __pyx_L0;
18728 :
18729 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":343
18730 : *
18731 : * @property
18732 : * cdef inline npy_intp* dimensions(self) noexcept nogil: # <<<<<<<<<<<<<<
18733 : * """The shape of the broadcasted result."""
18734 : * return PyArray_MultiIter_DIMS(self)
18735 : */
18736 :
18737 : /* function exit code */
18738 : __pyx_L0:;
18739 : return __pyx_r;
18740 : }
18741 :
18742 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
18743 : *
18744 : * @property
18745 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
18746 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18747 : * On return, the iterators are adjusted for broadcasting."""
18748 : */
18749 :
18750 : static CYTHON_INLINE void **__pyx_f_5numpy_9broadcast_5iters_iters(PyArrayMultiIterObject *__pyx_v_self) {
18751 : void **__pyx_r;
18752 :
18753 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":351
18754 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18755 : * On return, the iterators are adjusted for broadcasting."""
18756 : * return PyArray_MultiIter_ITERS(self) # <<<<<<<<<<<<<<
18757 : *
18758 : *
18759 : */
18760 : __pyx_r = PyArray_MultiIter_ITERS(__pyx_v_self);
18761 : goto __pyx_L0;
18762 :
18763 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":348
18764 : *
18765 : * @property
18766 : * cdef inline void** iters(self) noexcept nogil: # <<<<<<<<<<<<<<
18767 : * """An array of iterator objects that holds the iterators for the arrays to be broadcast together.
18768 : * On return, the iterators are adjusted for broadcasting."""
18769 : */
18770 :
18771 : /* function exit code */
18772 : __pyx_L0:;
18773 : return __pyx_r;
18774 : }
18775 :
18776 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
18777 : *
18778 : * @property
18779 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
18780 : * """Returns a borrowed reference to the object owning the data/memory.
18781 : * """
18782 : */
18783 :
18784 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
18785 : PyObject *__pyx_r;
18786 :
18787 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":369
18788 : * """Returns a borrowed reference to the object owning the data/memory.
18789 : * """
18790 : * return PyArray_BASE(self) # <<<<<<<<<<<<<<
18791 : *
18792 : * @property
18793 : */
18794 : __pyx_r = PyArray_BASE(__pyx_v_self);
18795 : goto __pyx_L0;
18796 :
18797 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":366
18798 : *
18799 : * @property
18800 : * cdef inline PyObject* base(self) noexcept nogil: # <<<<<<<<<<<<<<
18801 : * """Returns a borrowed reference to the object owning the data/memory.
18802 : * """
18803 : */
18804 :
18805 : /* function exit code */
18806 : __pyx_L0:;
18807 : return __pyx_r;
18808 : }
18809 :
18810 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
18811 : *
18812 : * @property
18813 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
18814 : * """Returns an owned reference to the dtype of the array.
18815 : * """
18816 : */
18817 :
18818 : static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArrayObject *__pyx_v_self) {
18819 : PyArray_Descr *__pyx_r = NULL;
18820 : __Pyx_RefNannyDeclarations
18821 : PyArray_Descr *__pyx_t_1;
18822 : __Pyx_RefNannySetupContext("descr", 1);
18823 :
18824 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":375
18825 : * """Returns an owned reference to the dtype of the array.
18826 : * """
18827 : * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
18828 : *
18829 : * @property
18830 : */
18831 : __Pyx_XDECREF((PyObject *)__pyx_r);
18832 : __pyx_t_1 = PyArray_DESCR(__pyx_v_self);
18833 : __Pyx_INCREF((PyObject *)((PyArray_Descr *)__pyx_t_1));
18834 : __pyx_r = ((PyArray_Descr *)__pyx_t_1);
18835 : goto __pyx_L0;
18836 :
18837 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":372
18838 : *
18839 : * @property
18840 : * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
18841 : * """Returns an owned reference to the dtype of the array.
18842 : * """
18843 : */
18844 :
18845 : /* function exit code */
18846 : __pyx_L0:;
18847 : __Pyx_XGIVEREF((PyObject *)__pyx_r);
18848 : __Pyx_RefNannyFinishContext();
18849 : return __pyx_r;
18850 : }
18851 :
18852 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
18853 : *
18854 : * @property
18855 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
18856 : * """Returns the number of dimensions in the array.
18857 : * """
18858 : */
18859 :
18860 : static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
18861 : int __pyx_r;
18862 :
18863 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":381
18864 : * """Returns the number of dimensions in the array.
18865 : * """
18866 : * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
18867 : *
18868 : * @property
18869 : */
18870 : __pyx_r = PyArray_NDIM(__pyx_v_self);
18871 : goto __pyx_L0;
18872 :
18873 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":378
18874 : *
18875 : * @property
18876 : * cdef inline int ndim(self) noexcept nogil: # <<<<<<<<<<<<<<
18877 : * """Returns the number of dimensions in the array.
18878 : * """
18879 : */
18880 :
18881 : /* function exit code */
18882 : __pyx_L0:;
18883 : return __pyx_r;
18884 : }
18885 :
18886 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
18887 : *
18888 : * @property
18889 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
18890 : * """Returns a pointer to the dimensions/shape of the array.
18891 : * The number of elements matches the number of dimensions of the array (ndim).
18892 : */
18893 :
18894 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
18895 : npy_intp *__pyx_r;
18896 :
18897 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":389
18898 : * Can return NULL for 0-dimensional arrays.
18899 : * """
18900 : * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
18901 : *
18902 : * @property
18903 : */
18904 : __pyx_r = PyArray_DIMS(__pyx_v_self);
18905 : goto __pyx_L0;
18906 :
18907 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":384
18908 : *
18909 : * @property
18910 : * cdef inline npy_intp *shape(self) noexcept nogil: # <<<<<<<<<<<<<<
18911 : * """Returns a pointer to the dimensions/shape of the array.
18912 : * The number of elements matches the number of dimensions of the array (ndim).
18913 : */
18914 :
18915 : /* function exit code */
18916 : __pyx_L0:;
18917 : return __pyx_r;
18918 : }
18919 :
18920 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
18921 : *
18922 : * @property
18923 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
18924 : * """Returns a pointer to the strides of the array.
18925 : * The number of elements matches the number of dimensions of the array (ndim).
18926 : */
18927 :
18928 : static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
18929 : npy_intp *__pyx_r;
18930 :
18931 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":396
18932 : * The number of elements matches the number of dimensions of the array (ndim).
18933 : * """
18934 : * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
18935 : *
18936 : * @property
18937 : */
18938 : __pyx_r = PyArray_STRIDES(__pyx_v_self);
18939 : goto __pyx_L0;
18940 :
18941 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":392
18942 : *
18943 : * @property
18944 : * cdef inline npy_intp *strides(self) noexcept nogil: # <<<<<<<<<<<<<<
18945 : * """Returns a pointer to the strides of the array.
18946 : * The number of elements matches the number of dimensions of the array (ndim).
18947 : */
18948 :
18949 : /* function exit code */
18950 : __pyx_L0:;
18951 : return __pyx_r;
18952 : }
18953 :
18954 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
18955 : *
18956 : * @property
18957 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18958 : * """Returns the total size (in number of elements) of the array.
18959 : * """
18960 : */
18961 :
18962 : static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
18963 : npy_intp __pyx_r;
18964 :
18965 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":402
18966 : * """Returns the total size (in number of elements) of the array.
18967 : * """
18968 : * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
18969 : *
18970 : * @property
18971 : */
18972 : __pyx_r = PyArray_SIZE(__pyx_v_self);
18973 : goto __pyx_L0;
18974 :
18975 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":399
18976 : *
18977 : * @property
18978 : * cdef inline npy_intp size(self) noexcept nogil: # <<<<<<<<<<<<<<
18979 : * """Returns the total size (in number of elements) of the array.
18980 : * """
18981 : */
18982 :
18983 : /* function exit code */
18984 : __pyx_L0:;
18985 : return __pyx_r;
18986 : }
18987 :
18988 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
18989 : *
18990 : * @property
18991 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
18992 : * """The pointer to the data buffer as a char*.
18993 : * This is provided for legacy reasons to avoid direct struct field access.
18994 : */
18995 :
18996 : static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
18997 : char *__pyx_r;
18998 :
18999 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":411
19000 : * of `PyArray_DATA()` instead, which returns a 'void*'.
19001 : * """
19002 : * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
19003 : *
19004 : *
19005 : */
19006 : __pyx_r = PyArray_BYTES(__pyx_v_self);
19007 : goto __pyx_L0;
19008 :
19009 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":405
19010 : *
19011 : * @property
19012 : * cdef inline char* data(self) noexcept nogil: # <<<<<<<<<<<<<<
19013 : * """The pointer to the data buffer as a char*.
19014 : * This is provided for legacy reasons to avoid direct struct field access.
19015 : */
19016 :
19017 : /* function exit code */
19018 : __pyx_L0:;
19019 : return __pyx_r;
19020 : }
19021 :
19022 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19023 : * ctypedef long double complex clongdouble_t
19024 : *
19025 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19026 : * return PyArray_MultiIterNew(1, <void*>a)
19027 : *
19028 : */
19029 :
19030 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
19031 : PyObject *__pyx_r = NULL;
19032 : __Pyx_RefNannyDeclarations
19033 : PyObject *__pyx_t_1 = NULL;
19034 : int __pyx_lineno = 0;
19035 : const char *__pyx_filename = NULL;
19036 : int __pyx_clineno = 0;
19037 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19038 :
19039 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":807
19040 : *
19041 : * cdef inline object PyArray_MultiIterNew1(a):
19042 : * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
19043 : *
19044 : * cdef inline object PyArray_MultiIterNew2(a, b):
19045 : */
19046 : __Pyx_XDECREF(__pyx_r);
19047 : __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 807, __pyx_L1_error)
19048 : __Pyx_GOTREF(__pyx_t_1);
19049 : __pyx_r = __pyx_t_1;
19050 : __pyx_t_1 = 0;
19051 : goto __pyx_L0;
19052 :
19053 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":806
19054 : * ctypedef long double complex clongdouble_t
19055 : *
19056 : * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
19057 : * return PyArray_MultiIterNew(1, <void*>a)
19058 : *
19059 : */
19060 :
19061 : /* function exit code */
19062 : __pyx_L1_error:;
19063 : __Pyx_XDECREF(__pyx_t_1);
19064 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
19065 : __pyx_r = 0;
19066 : __pyx_L0:;
19067 : __Pyx_XGIVEREF(__pyx_r);
19068 : __Pyx_RefNannyFinishContext();
19069 : return __pyx_r;
19070 : }
19071 :
19072 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19073 : * return PyArray_MultiIterNew(1, <void*>a)
19074 : *
19075 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19076 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19077 : *
19078 : */
19079 :
19080 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
19081 : PyObject *__pyx_r = NULL;
19082 : __Pyx_RefNannyDeclarations
19083 : PyObject *__pyx_t_1 = NULL;
19084 : int __pyx_lineno = 0;
19085 : const char *__pyx_filename = NULL;
19086 : int __pyx_clineno = 0;
19087 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19088 :
19089 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":810
19090 : *
19091 : * cdef inline object PyArray_MultiIterNew2(a, b):
19092 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
19093 : *
19094 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19095 : */
19096 : __Pyx_XDECREF(__pyx_r);
19097 : __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 810, __pyx_L1_error)
19098 : __Pyx_GOTREF(__pyx_t_1);
19099 : __pyx_r = __pyx_t_1;
19100 : __pyx_t_1 = 0;
19101 : goto __pyx_L0;
19102 :
19103 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":809
19104 : * return PyArray_MultiIterNew(1, <void*>a)
19105 : *
19106 : * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
19107 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19108 : *
19109 : */
19110 :
19111 : /* function exit code */
19112 : __pyx_L1_error:;
19113 : __Pyx_XDECREF(__pyx_t_1);
19114 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
19115 : __pyx_r = 0;
19116 : __pyx_L0:;
19117 : __Pyx_XGIVEREF(__pyx_r);
19118 : __Pyx_RefNannyFinishContext();
19119 : return __pyx_r;
19120 : }
19121 :
19122 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19123 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19124 : *
19125 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19126 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19127 : *
19128 : */
19129 :
19130 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
19131 : PyObject *__pyx_r = NULL;
19132 : __Pyx_RefNannyDeclarations
19133 : PyObject *__pyx_t_1 = NULL;
19134 : int __pyx_lineno = 0;
19135 : const char *__pyx_filename = NULL;
19136 : int __pyx_clineno = 0;
19137 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19138 :
19139 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":813
19140 : *
19141 : * cdef inline object PyArray_MultiIterNew3(a, b, c):
19142 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
19143 : *
19144 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19145 : */
19146 : __Pyx_XDECREF(__pyx_r);
19147 : __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 813, __pyx_L1_error)
19148 : __Pyx_GOTREF(__pyx_t_1);
19149 : __pyx_r = __pyx_t_1;
19150 : __pyx_t_1 = 0;
19151 : goto __pyx_L0;
19152 :
19153 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":812
19154 : * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19155 : *
19156 : * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
19157 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19158 : *
19159 : */
19160 :
19161 : /* function exit code */
19162 : __pyx_L1_error:;
19163 : __Pyx_XDECREF(__pyx_t_1);
19164 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19165 : __pyx_r = 0;
19166 : __pyx_L0:;
19167 : __Pyx_XGIVEREF(__pyx_r);
19168 : __Pyx_RefNannyFinishContext();
19169 : return __pyx_r;
19170 : }
19171 :
19172 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19173 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19174 : *
19175 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19176 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19177 : *
19178 : */
19179 :
19180 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
19181 : PyObject *__pyx_r = NULL;
19182 : __Pyx_RefNannyDeclarations
19183 : PyObject *__pyx_t_1 = NULL;
19184 : int __pyx_lineno = 0;
19185 : const char *__pyx_filename = NULL;
19186 : int __pyx_clineno = 0;
19187 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19188 :
19189 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":816
19190 : *
19191 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19192 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
19193 : *
19194 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19195 : */
19196 : __Pyx_XDECREF(__pyx_r);
19197 : __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 816, __pyx_L1_error)
19198 : __Pyx_GOTREF(__pyx_t_1);
19199 : __pyx_r = __pyx_t_1;
19200 : __pyx_t_1 = 0;
19201 : goto __pyx_L0;
19202 :
19203 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":815
19204 : * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19205 : *
19206 : * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
19207 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19208 : *
19209 : */
19210 :
19211 : /* function exit code */
19212 : __pyx_L1_error:;
19213 : __Pyx_XDECREF(__pyx_t_1);
19214 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19215 : __pyx_r = 0;
19216 : __pyx_L0:;
19217 : __Pyx_XGIVEREF(__pyx_r);
19218 : __Pyx_RefNannyFinishContext();
19219 : return __pyx_r;
19220 : }
19221 :
19222 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19223 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19224 : *
19225 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19226 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19227 : *
19228 : */
19229 :
19230 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
19231 : PyObject *__pyx_r = NULL;
19232 : __Pyx_RefNannyDeclarations
19233 : PyObject *__pyx_t_1 = NULL;
19234 : int __pyx_lineno = 0;
19235 : const char *__pyx_filename = NULL;
19236 : int __pyx_clineno = 0;
19237 : __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19238 :
19239 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":819
19240 : *
19241 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19242 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
19243 : *
19244 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19245 : */
19246 : __Pyx_XDECREF(__pyx_r);
19247 : __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 819, __pyx_L1_error)
19248 : __Pyx_GOTREF(__pyx_t_1);
19249 : __pyx_r = __pyx_t_1;
19250 : __pyx_t_1 = 0;
19251 : goto __pyx_L0;
19252 :
19253 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":818
19254 : * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19255 : *
19256 : * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
19257 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19258 : *
19259 : */
19260 :
19261 : /* function exit code */
19262 : __pyx_L1_error:;
19263 : __Pyx_XDECREF(__pyx_t_1);
19264 : __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
19265 : __pyx_r = 0;
19266 : __pyx_L0:;
19267 : __Pyx_XGIVEREF(__pyx_r);
19268 : __Pyx_RefNannyFinishContext();
19269 : return __pyx_r;
19270 : }
19271 :
19272 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
19273 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19274 : *
19275 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19276 : * if PyDataType_HASSUBARRAY(d):
19277 : * return <tuple>d.subarray.shape
19278 : */
19279 :
19280 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
19281 : PyObject *__pyx_r = NULL;
19282 : __Pyx_RefNannyDeclarations
19283 : int __pyx_t_1;
19284 : PyObject *__pyx_t_2;
19285 : __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
19286 :
19287 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
19288 : *
19289 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19290 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19291 : * return <tuple>d.subarray.shape
19292 : * else:
19293 : */
19294 : __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19295 : if (__pyx_t_1) {
19296 :
19297 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":823
19298 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19299 : * if PyDataType_HASSUBARRAY(d):
19300 : * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
19301 : * else:
19302 : * return ()
19303 : */
19304 : __Pyx_XDECREF(__pyx_r);
19305 : __pyx_t_2 = __pyx_f_5numpy_5dtype_8subarray_subarray(__pyx_v_d)->shape;
19306 : __Pyx_INCREF(((PyObject*)__pyx_t_2));
19307 : __pyx_r = ((PyObject*)__pyx_t_2);
19308 : goto __pyx_L0;
19309 :
19310 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":822
19311 : *
19312 : * cdef inline tuple PyDataType_SHAPE(dtype d):
19313 : * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
19314 : * return <tuple>d.subarray.shape
19315 : * else:
19316 : */
19317 : }
19318 :
19319 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":825
19320 : * return <tuple>d.subarray.shape
19321 : * else:
19322 : * return () # <<<<<<<<<<<<<<
19323 : *
19324 : *
19325 : */
19326 : /*else*/ {
19327 : __Pyx_XDECREF(__pyx_r);
19328 : __Pyx_INCREF(__pyx_empty_tuple);
19329 : __pyx_r = __pyx_empty_tuple;
19330 : goto __pyx_L0;
19331 : }
19332 :
19333 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":821
19334 : * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19335 : *
19336 : * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
19337 : * if PyDataType_HASSUBARRAY(d):
19338 : * return <tuple>d.subarray.shape
19339 : */
19340 :
19341 : /* function exit code */
19342 : __pyx_L0:;
19343 : __Pyx_XGIVEREF(__pyx_r);
19344 : __Pyx_RefNannyFinishContext();
19345 : return __pyx_r;
19346 : }
19347 :
19348 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
19349 : * int _import_umath() except -1
19350 : *
19351 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
19352 : * Py_INCREF(base) # important to do this before stealing the reference below!
19353 : * PyArray_SetBaseObject(arr, base)
19354 : */
19355 :
19356 : static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19357 : int __pyx_t_1;
19358 : int __pyx_lineno = 0;
19359 : const char *__pyx_filename = NULL;
19360 : int __pyx_clineno = 0;
19361 :
19362 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1010
19363 : *
19364 : * cdef inline void set_array_base(ndarray arr, object base) except *:
19365 : * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
19366 : * PyArray_SetBaseObject(arr, base)
19367 : *
19368 : */
19369 : Py_INCREF(__pyx_v_base);
19370 :
19371 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1011
19372 : * cdef inline void set_array_base(ndarray arr, object base) except *:
19373 : * Py_INCREF(base) # important to do this before stealing the reference below!
19374 : * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
19375 : *
19376 : * cdef inline object get_array_base(ndarray arr):
19377 : */
19378 : __pyx_t_1 = PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 1011, __pyx_L1_error)
19379 :
19380 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1009
19381 : * int _import_umath() except -1
19382 : *
19383 : * cdef inline void set_array_base(ndarray arr, object base) except *: # <<<<<<<<<<<<<<
19384 : * Py_INCREF(base) # important to do this before stealing the reference below!
19385 : * PyArray_SetBaseObject(arr, base)
19386 : */
19387 :
19388 : /* function exit code */
19389 : goto __pyx_L0;
19390 : __pyx_L1_error:;
19391 : __Pyx_AddTraceback("numpy.set_array_base", __pyx_clineno, __pyx_lineno, __pyx_filename);
19392 : __pyx_L0:;
19393 : }
19394 :
19395 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
19396 : * PyArray_SetBaseObject(arr, base)
19397 : *
19398 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19399 : * base = PyArray_BASE(arr)
19400 : * if base is NULL:
19401 : */
19402 :
19403 : static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
19404 : PyObject *__pyx_v_base;
19405 : PyObject *__pyx_r = NULL;
19406 : __Pyx_RefNannyDeclarations
19407 : int __pyx_t_1;
19408 : __Pyx_RefNannySetupContext("get_array_base", 1);
19409 :
19410 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1014
19411 : *
19412 : * cdef inline object get_array_base(ndarray arr):
19413 : * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
19414 : * if base is NULL:
19415 : * return None
19416 : */
19417 : __pyx_v_base = PyArray_BASE(__pyx_v_arr);
19418 :
19419 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
19420 : * cdef inline object get_array_base(ndarray arr):
19421 : * base = PyArray_BASE(arr)
19422 : * if base is NULL: # <<<<<<<<<<<<<<
19423 : * return None
19424 : * return <object>base
19425 : */
19426 : __pyx_t_1 = (__pyx_v_base == NULL);
19427 : if (__pyx_t_1) {
19428 :
19429 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1016
19430 : * base = PyArray_BASE(arr)
19431 : * if base is NULL:
19432 : * return None # <<<<<<<<<<<<<<
19433 : * return <object>base
19434 : *
19435 : */
19436 : __Pyx_XDECREF(__pyx_r);
19437 : __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19438 : goto __pyx_L0;
19439 :
19440 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1015
19441 : * cdef inline object get_array_base(ndarray arr):
19442 : * base = PyArray_BASE(arr)
19443 : * if base is NULL: # <<<<<<<<<<<<<<
19444 : * return None
19445 : * return <object>base
19446 : */
19447 : }
19448 :
19449 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1017
19450 : * if base is NULL:
19451 : * return None
19452 : * return <object>base # <<<<<<<<<<<<<<
19453 : *
19454 : * # Versions of the import_* functions which are more suitable for
19455 : */
19456 : __Pyx_XDECREF(__pyx_r);
19457 : __Pyx_INCREF(((PyObject *)__pyx_v_base));
19458 : __pyx_r = ((PyObject *)__pyx_v_base);
19459 : goto __pyx_L0;
19460 :
19461 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1013
19462 : * PyArray_SetBaseObject(arr, base)
19463 : *
19464 : * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
19465 : * base = PyArray_BASE(arr)
19466 : * if base is NULL:
19467 : */
19468 :
19469 : /* function exit code */
19470 : __pyx_L0:;
19471 : __Pyx_XGIVEREF(__pyx_r);
19472 : __Pyx_RefNannyFinishContext();
19473 : return __pyx_r;
19474 : }
19475 :
19476 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
19477 : * # Versions of the import_* functions which are more suitable for
19478 : * # Cython code.
19479 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
19480 : * try:
19481 : * __pyx_import_array()
19482 : */
19483 :
19484 3 : static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
19485 3 : int __pyx_r;
19486 : __Pyx_RefNannyDeclarations
19487 3 : PyObject *__pyx_t_1 = NULL;
19488 3 : PyObject *__pyx_t_2 = NULL;
19489 3 : PyObject *__pyx_t_3 = NULL;
19490 3 : int __pyx_t_4;
19491 3 : PyObject *__pyx_t_5 = NULL;
19492 3 : PyObject *__pyx_t_6 = NULL;
19493 3 : PyObject *__pyx_t_7 = NULL;
19494 3 : PyObject *__pyx_t_8 = NULL;
19495 3 : int __pyx_lineno = 0;
19496 3 : const char *__pyx_filename = NULL;
19497 3 : int __pyx_clineno = 0;
19498 3 : __Pyx_RefNannySetupContext("import_array", 1);
19499 :
19500 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19501 : * # Cython code.
19502 : * cdef inline int import_array() except -1:
19503 : * try: # <<<<<<<<<<<<<<
19504 : * __pyx_import_array()
19505 : * except Exception:
19506 : */
19507 : {
19508 3 : __Pyx_PyThreadState_declare
19509 3 : __Pyx_PyThreadState_assign
19510 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19511 3 : __Pyx_XGOTREF(__pyx_t_1);
19512 3 : __Pyx_XGOTREF(__pyx_t_2);
19513 3 : __Pyx_XGOTREF(__pyx_t_3);
19514 : /*try:*/ {
19515 :
19516 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1023
19517 : * cdef inline int import_array() except -1:
19518 : * try:
19519 : * __pyx_import_array() # <<<<<<<<<<<<<<
19520 : * except Exception:
19521 : * raise ImportError("numpy._core.multiarray failed to import")
19522 : */
19523 3 : __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1023, __pyx_L3_error)
19524 :
19525 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19526 : * # Cython code.
19527 : * cdef inline int import_array() except -1:
19528 : * try: # <<<<<<<<<<<<<<
19529 : * __pyx_import_array()
19530 : * except Exception:
19531 : */
19532 : }
19533 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19534 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19535 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19536 3 : goto __pyx_L8_try_end;
19537 0 : __pyx_L3_error:;
19538 :
19539 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1024
19540 : * try:
19541 : * __pyx_import_array()
19542 : * except Exception: # <<<<<<<<<<<<<<
19543 : * raise ImportError("numpy._core.multiarray failed to import")
19544 : *
19545 : */
19546 0 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19547 0 : if (__pyx_t_4) {
19548 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
19549 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1024, __pyx_L5_except_error)
19550 0 : __Pyx_XGOTREF(__pyx_t_5);
19551 0 : __Pyx_XGOTREF(__pyx_t_6);
19552 0 : __Pyx_XGOTREF(__pyx_t_7);
19553 :
19554 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
19555 : * __pyx_import_array()
19556 : * except Exception:
19557 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
19558 : *
19559 : * cdef inline int import_umath() except -1:
19560 : */
19561 0 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1025, __pyx_L5_except_error)
19562 0 : __Pyx_GOTREF(__pyx_t_8);
19563 0 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19564 0 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19565 0 : __PYX_ERR(2, 1025, __pyx_L5_except_error)
19566 : }
19567 0 : goto __pyx_L5_except_error;
19568 :
19569 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1022
19570 : * # Cython code.
19571 : * cdef inline int import_array() except -1:
19572 : * try: # <<<<<<<<<<<<<<
19573 : * __pyx_import_array()
19574 : * except Exception:
19575 : */
19576 0 : __pyx_L5_except_error:;
19577 0 : __Pyx_XGIVEREF(__pyx_t_1);
19578 0 : __Pyx_XGIVEREF(__pyx_t_2);
19579 0 : __Pyx_XGIVEREF(__pyx_t_3);
19580 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19581 0 : goto __pyx_L1_error;
19582 3 : __pyx_L8_try_end:;
19583 : }
19584 :
19585 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1021
19586 : * # Versions of the import_* functions which are more suitable for
19587 : * # Cython code.
19588 : * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
19589 : * try:
19590 : * __pyx_import_array()
19591 : */
19592 :
19593 : /* function exit code */
19594 3 : __pyx_r = 0;
19595 3 : goto __pyx_L0;
19596 0 : __pyx_L1_error:;
19597 0 : __Pyx_XDECREF(__pyx_t_5);
19598 0 : __Pyx_XDECREF(__pyx_t_6);
19599 0 : __Pyx_XDECREF(__pyx_t_7);
19600 0 : __Pyx_XDECREF(__pyx_t_8);
19601 0 : __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
19602 0 : __pyx_r = -1;
19603 3 : __pyx_L0:;
19604 3 : __Pyx_RefNannyFinishContext();
19605 3 : return __pyx_r;
19606 : }
19607 :
19608 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
19609 : * raise ImportError("numpy._core.multiarray failed to import")
19610 : *
19611 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
19612 : * try:
19613 : * _import_umath()
19614 : */
19615 :
19616 : static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
19617 : int __pyx_r;
19618 : __Pyx_RefNannyDeclarations
19619 : PyObject *__pyx_t_1 = NULL;
19620 : PyObject *__pyx_t_2 = NULL;
19621 : PyObject *__pyx_t_3 = NULL;
19622 : int __pyx_t_4;
19623 : PyObject *__pyx_t_5 = NULL;
19624 : PyObject *__pyx_t_6 = NULL;
19625 : PyObject *__pyx_t_7 = NULL;
19626 : PyObject *__pyx_t_8 = NULL;
19627 : int __pyx_lineno = 0;
19628 : const char *__pyx_filename = NULL;
19629 : int __pyx_clineno = 0;
19630 : __Pyx_RefNannySetupContext("import_umath", 1);
19631 :
19632 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19633 : *
19634 : * cdef inline int import_umath() except -1:
19635 : * try: # <<<<<<<<<<<<<<
19636 : * _import_umath()
19637 : * except Exception:
19638 : */
19639 : {
19640 : __Pyx_PyThreadState_declare
19641 : __Pyx_PyThreadState_assign
19642 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19643 : __Pyx_XGOTREF(__pyx_t_1);
19644 : __Pyx_XGOTREF(__pyx_t_2);
19645 : __Pyx_XGOTREF(__pyx_t_3);
19646 : /*try:*/ {
19647 :
19648 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1029
19649 : * cdef inline int import_umath() except -1:
19650 : * try:
19651 : * _import_umath() # <<<<<<<<<<<<<<
19652 : * except Exception:
19653 : * raise ImportError("numpy._core.umath failed to import")
19654 : */
19655 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1029, __pyx_L3_error)
19656 :
19657 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19658 : *
19659 : * cdef inline int import_umath() except -1:
19660 : * try: # <<<<<<<<<<<<<<
19661 : * _import_umath()
19662 : * except Exception:
19663 : */
19664 : }
19665 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19666 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19667 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19668 : goto __pyx_L8_try_end;
19669 : __pyx_L3_error:;
19670 :
19671 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1030
19672 : * try:
19673 : * _import_umath()
19674 : * except Exception: # <<<<<<<<<<<<<<
19675 : * raise ImportError("numpy._core.umath failed to import")
19676 : *
19677 : */
19678 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19679 : if (__pyx_t_4) {
19680 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19681 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1030, __pyx_L5_except_error)
19682 : __Pyx_XGOTREF(__pyx_t_5);
19683 : __Pyx_XGOTREF(__pyx_t_6);
19684 : __Pyx_XGOTREF(__pyx_t_7);
19685 :
19686 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
19687 : * _import_umath()
19688 : * except Exception:
19689 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
19690 : *
19691 : * cdef inline int import_ufunc() except -1:
19692 : */
19693 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1031, __pyx_L5_except_error)
19694 : __Pyx_GOTREF(__pyx_t_8);
19695 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19696 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19697 : __PYX_ERR(2, 1031, __pyx_L5_except_error)
19698 : }
19699 : goto __pyx_L5_except_error;
19700 :
19701 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1028
19702 : *
19703 : * cdef inline int import_umath() except -1:
19704 : * try: # <<<<<<<<<<<<<<
19705 : * _import_umath()
19706 : * except Exception:
19707 : */
19708 : __pyx_L5_except_error:;
19709 : __Pyx_XGIVEREF(__pyx_t_1);
19710 : __Pyx_XGIVEREF(__pyx_t_2);
19711 : __Pyx_XGIVEREF(__pyx_t_3);
19712 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19713 : goto __pyx_L1_error;
19714 : __pyx_L8_try_end:;
19715 : }
19716 :
19717 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1027
19718 : * raise ImportError("numpy._core.multiarray failed to import")
19719 : *
19720 : * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
19721 : * try:
19722 : * _import_umath()
19723 : */
19724 :
19725 : /* function exit code */
19726 : __pyx_r = 0;
19727 : goto __pyx_L0;
19728 : __pyx_L1_error:;
19729 : __Pyx_XDECREF(__pyx_t_5);
19730 : __Pyx_XDECREF(__pyx_t_6);
19731 : __Pyx_XDECREF(__pyx_t_7);
19732 : __Pyx_XDECREF(__pyx_t_8);
19733 : __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
19734 : __pyx_r = -1;
19735 : __pyx_L0:;
19736 : __Pyx_RefNannyFinishContext();
19737 : return __pyx_r;
19738 : }
19739 :
19740 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
19741 : * raise ImportError("numpy._core.umath failed to import")
19742 : *
19743 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
19744 : * try:
19745 : * _import_umath()
19746 : */
19747 :
19748 : static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
19749 : int __pyx_r;
19750 : __Pyx_RefNannyDeclarations
19751 : PyObject *__pyx_t_1 = NULL;
19752 : PyObject *__pyx_t_2 = NULL;
19753 : PyObject *__pyx_t_3 = NULL;
19754 : int __pyx_t_4;
19755 : PyObject *__pyx_t_5 = NULL;
19756 : PyObject *__pyx_t_6 = NULL;
19757 : PyObject *__pyx_t_7 = NULL;
19758 : PyObject *__pyx_t_8 = NULL;
19759 : int __pyx_lineno = 0;
19760 : const char *__pyx_filename = NULL;
19761 : int __pyx_clineno = 0;
19762 : __Pyx_RefNannySetupContext("import_ufunc", 1);
19763 :
19764 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19765 : *
19766 : * cdef inline int import_ufunc() except -1:
19767 : * try: # <<<<<<<<<<<<<<
19768 : * _import_umath()
19769 : * except Exception:
19770 : */
19771 : {
19772 : __Pyx_PyThreadState_declare
19773 : __Pyx_PyThreadState_assign
19774 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
19775 : __Pyx_XGOTREF(__pyx_t_1);
19776 : __Pyx_XGOTREF(__pyx_t_2);
19777 : __Pyx_XGOTREF(__pyx_t_3);
19778 : /*try:*/ {
19779 :
19780 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1035
19781 : * cdef inline int import_ufunc() except -1:
19782 : * try:
19783 : * _import_umath() # <<<<<<<<<<<<<<
19784 : * except Exception:
19785 : * raise ImportError("numpy._core.umath failed to import")
19786 : */
19787 : __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1035, __pyx_L3_error)
19788 :
19789 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19790 : *
19791 : * cdef inline int import_ufunc() except -1:
19792 : * try: # <<<<<<<<<<<<<<
19793 : * _import_umath()
19794 : * except Exception:
19795 : */
19796 : }
19797 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
19798 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19799 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
19800 : goto __pyx_L8_try_end;
19801 : __pyx_L3_error:;
19802 :
19803 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1036
19804 : * try:
19805 : * _import_umath()
19806 : * except Exception: # <<<<<<<<<<<<<<
19807 : * raise ImportError("numpy._core.umath failed to import")
19808 : *
19809 : */
19810 : __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
19811 : if (__pyx_t_4) {
19812 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
19813 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1036, __pyx_L5_except_error)
19814 : __Pyx_XGOTREF(__pyx_t_5);
19815 : __Pyx_XGOTREF(__pyx_t_6);
19816 : __Pyx_XGOTREF(__pyx_t_7);
19817 :
19818 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1037
19819 : * _import_umath()
19820 : * except Exception:
19821 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
19822 : *
19823 : *
19824 : */
19825 : __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1037, __pyx_L5_except_error)
19826 : __Pyx_GOTREF(__pyx_t_8);
19827 : __Pyx_Raise(__pyx_t_8, 0, 0, 0);
19828 : __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19829 : __PYX_ERR(2, 1037, __pyx_L5_except_error)
19830 : }
19831 : goto __pyx_L5_except_error;
19832 :
19833 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1034
19834 : *
19835 : * cdef inline int import_ufunc() except -1:
19836 : * try: # <<<<<<<<<<<<<<
19837 : * _import_umath()
19838 : * except Exception:
19839 : */
19840 : __pyx_L5_except_error:;
19841 : __Pyx_XGIVEREF(__pyx_t_1);
19842 : __Pyx_XGIVEREF(__pyx_t_2);
19843 : __Pyx_XGIVEREF(__pyx_t_3);
19844 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
19845 : goto __pyx_L1_error;
19846 : __pyx_L8_try_end:;
19847 : }
19848 :
19849 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1033
19850 : * raise ImportError("numpy._core.umath failed to import")
19851 : *
19852 : * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
19853 : * try:
19854 : * _import_umath()
19855 : */
19856 :
19857 : /* function exit code */
19858 : __pyx_r = 0;
19859 : goto __pyx_L0;
19860 : __pyx_L1_error:;
19861 : __Pyx_XDECREF(__pyx_t_5);
19862 : __Pyx_XDECREF(__pyx_t_6);
19863 : __Pyx_XDECREF(__pyx_t_7);
19864 : __Pyx_XDECREF(__pyx_t_8);
19865 : __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
19866 : __pyx_r = -1;
19867 : __pyx_L0:;
19868 : __Pyx_RefNannyFinishContext();
19869 : return __pyx_r;
19870 : }
19871 :
19872 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
19873 : *
19874 : *
19875 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
19876 : * """
19877 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
19878 : */
19879 :
19880 : static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
19881 : int __pyx_r;
19882 :
19883 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1052
19884 : * bool
19885 : * """
19886 : * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
19887 : *
19888 : *
19889 : */
19890 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
19891 : goto __pyx_L0;
19892 :
19893 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1040
19894 : *
19895 : *
19896 : * cdef inline bint is_timedelta64_object(object obj) noexcept: # <<<<<<<<<<<<<<
19897 : * """
19898 : * Cython equivalent of `isinstance(obj, np.timedelta64)`
19899 : */
19900 :
19901 : /* function exit code */
19902 : __pyx_L0:;
19903 : return __pyx_r;
19904 : }
19905 :
19906 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
19907 : *
19908 : *
19909 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
19910 : * """
19911 : * Cython equivalent of `isinstance(obj, np.datetime64)`
19912 : */
19913 :
19914 : static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
19915 : int __pyx_r;
19916 :
19917 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1067
19918 : * bool
19919 : * """
19920 : * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
19921 : *
19922 : *
19923 : */
19924 : __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
19925 : goto __pyx_L0;
19926 :
19927 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1055
19928 : *
19929 : *
19930 : * cdef inline bint is_datetime64_object(object obj) noexcept: # <<<<<<<<<<<<<<
19931 : * """
19932 : * Cython equivalent of `isinstance(obj, np.datetime64)`
19933 : */
19934 :
19935 : /* function exit code */
19936 : __pyx_L0:;
19937 : return __pyx_r;
19938 : }
19939 :
19940 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
19941 : *
19942 : *
19943 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19944 : * """
19945 : * returns the int64 value underlying scalar numpy datetime64 object
19946 : */
19947 :
19948 : static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
19949 : npy_datetime __pyx_r;
19950 :
19951 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1077
19952 : * also needed. That can be found using `get_datetime64_unit`.
19953 : * """
19954 : * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
19955 : *
19956 : *
19957 : */
19958 : __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
19959 : goto __pyx_L0;
19960 :
19961 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1070
19962 : *
19963 : *
19964 : * cdef inline npy_datetime get_datetime64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19965 : * """
19966 : * returns the int64 value underlying scalar numpy datetime64 object
19967 : */
19968 :
19969 : /* function exit code */
19970 : __pyx_L0:;
19971 : return __pyx_r;
19972 : }
19973 :
19974 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
19975 : *
19976 : *
19977 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19978 : * """
19979 : * returns the int64 value underlying scalar numpy timedelta64 object
19980 : */
19981 :
19982 : static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
19983 : npy_timedelta __pyx_r;
19984 :
19985 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1084
19986 : * returns the int64 value underlying scalar numpy timedelta64 object
19987 : * """
19988 : * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
19989 : *
19990 : *
19991 : */
19992 : __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
19993 : goto __pyx_L0;
19994 :
19995 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1080
19996 : *
19997 : *
19998 : * cdef inline npy_timedelta get_timedelta64_value(object obj) noexcept nogil: # <<<<<<<<<<<<<<
19999 : * """
20000 : * returns the int64 value underlying scalar numpy timedelta64 object
20001 : */
20002 :
20003 : /* function exit code */
20004 : __pyx_L0:;
20005 : return __pyx_r;
20006 : }
20007 :
20008 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20009 : *
20010 : *
20011 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20012 : * """
20013 : * returns the unit part of the dtype for a numpy datetime64 object.
20014 : */
20015 :
20016 : static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20017 : NPY_DATETIMEUNIT __pyx_r;
20018 :
20019 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1091
20020 : * returns the unit part of the dtype for a numpy datetime64 object.
20021 : * """
20022 : * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
20023 : *
20024 : *
20025 : */
20026 : __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20027 : goto __pyx_L0;
20028 :
20029 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1087
20030 : *
20031 : *
20032 : * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) noexcept nogil: # <<<<<<<<<<<<<<
20033 : * """
20034 : * returns the unit part of the dtype for a numpy datetime64 object.
20035 : */
20036 :
20037 : /* function exit code */
20038 : __pyx_L0:;
20039 : return __pyx_r;
20040 : }
20041 :
20042 : /* "scipy/signal/_peak_finding_utils.pyx":20
20043 : *
20044 : *
20045 : * def _local_maxima_1d(const np.float64_t[::1] x not None): # <<<<<<<<<<<<<<
20046 : * """
20047 : * Find local maxima in a 1D array.
20048 : */
20049 :
20050 : /* Python wrapper */
20051 : static PyObject *__pyx_pw_5scipy_6signal_19_peak_finding_utils_1_local_maxima_1d(PyObject *__pyx_self,
20052 : #if CYTHON_METH_FASTCALL
20053 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20054 : #else
20055 : PyObject *__pyx_args, PyObject *__pyx_kwds
20056 : #endif
20057 : ); /*proto*/
20058 : PyDoc_STRVAR(__pyx_doc_5scipy_6signal_19_peak_finding_utils__local_maxima_1d, "\n Find local maxima in a 1D array.\n\n This function finds all local maxima in a 1D array and returns the indices\n for their edges and midpoints (rounded down for even plateau sizes).\n\n Parameters\n ----------\n x : ndarray\n The array to search for local maxima.\n\n Returns\n -------\n midpoints : ndarray\n Indices of midpoints of local maxima in `x`.\n left_edges : ndarray\n Indices of edges to the left of local maxima in `x`.\n right_edges : ndarray\n Indices of edges to the right of local maxima in `x`.\n\n Notes\n -----\n - Compared to `argrelmax` this function is significantly faster and can\n detect maxima that are more than one sample wide. However this comes at\n the cost of being only applicable to 1D arrays.\n - A maxima is defined as one or more samples of equal value that are\n surrounded on both sides by at least one smaller sample.\n\n .. versionadded:: 1.1.0\n ");
20059 : static PyMethodDef __pyx_mdef_5scipy_6signal_19_peak_finding_utils_1_local_maxima_1d = {"_local_maxima_1d", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6signal_19_peak_finding_utils_1_local_maxima_1d, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6signal_19_peak_finding_utils__local_maxima_1d};
20060 41 : static PyObject *__pyx_pw_5scipy_6signal_19_peak_finding_utils_1_local_maxima_1d(PyObject *__pyx_self,
20061 : #if CYTHON_METH_FASTCALL
20062 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20063 : #else
20064 : PyObject *__pyx_args, PyObject *__pyx_kwds
20065 : #endif
20066 : ) {
20067 41 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
20068 : #if !CYTHON_METH_FASTCALL
20069 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20070 : #endif
20071 41 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20072 41 : PyObject* values[1] = {0};
20073 41 : int __pyx_lineno = 0;
20074 41 : const char *__pyx_filename = NULL;
20075 41 : int __pyx_clineno = 0;
20076 41 : PyObject *__pyx_r = 0;
20077 : __Pyx_RefNannyDeclarations
20078 41 : __Pyx_RefNannySetupContext("_local_maxima_1d (wrapper)", 0);
20079 : #if !CYTHON_METH_FASTCALL
20080 : #if CYTHON_ASSUME_SAFE_MACROS
20081 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20082 : #else
20083 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20084 : #endif
20085 : #endif
20086 41 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20087 : {
20088 41 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0};
20089 41 : if (__pyx_kwds) {
20090 0 : Py_ssize_t kw_args;
20091 0 : switch (__pyx_nargs) {
20092 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20093 0 : CYTHON_FALLTHROUGH;
20094 0 : case 0: break;
20095 0 : default: goto __pyx_L5_argtuple_error;
20096 : }
20097 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
20098 0 : switch (__pyx_nargs) {
20099 : case 0:
20100 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
20101 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
20102 0 : kw_args--;
20103 : }
20104 3 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 20, __pyx_L3_error)
20105 0 : else goto __pyx_L5_argtuple_error;
20106 : }
20107 0 : if (unlikely(kw_args > 0)) {
20108 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
20109 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_local_maxima_1d") < 0)) __PYX_ERR(0, 20, __pyx_L3_error)
20110 : }
20111 41 : } else if (unlikely(__pyx_nargs != 1)) {
20112 0 : goto __pyx_L5_argtuple_error;
20113 : } else {
20114 41 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20115 : }
20116 41 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 20, __pyx_L3_error)
20117 : }
20118 38 : goto __pyx_L6_skip;
20119 0 : __pyx_L5_argtuple_error:;
20120 0 : __Pyx_RaiseArgtupleInvalid("_local_maxima_1d", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 20, __pyx_L3_error)
20121 38 : __pyx_L6_skip:;
20122 38 : goto __pyx_L4_argument_unpacking_done;
20123 3 : __pyx_L3_error:;
20124 : {
20125 3 : Py_ssize_t __pyx_temp;
20126 3 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20127 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20128 : }
20129 : }
20130 3 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
20131 3 : __Pyx_AddTraceback("scipy.signal._peak_finding_utils._local_maxima_1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
20132 3 : __Pyx_RefNannyFinishContext();
20133 3 : return NULL;
20134 38 : __pyx_L4_argument_unpacking_done:;
20135 38 : if (unlikely(((PyObject *)__pyx_v_x.memview) == Py_None)) {
20136 1 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "x"); __PYX_ERR(0, 20, __pyx_L1_error)
20137 : }
20138 37 : __pyx_r = __pyx_pf_5scipy_6signal_19_peak_finding_utils__local_maxima_1d(__pyx_self, __pyx_v_x);
20139 :
20140 : /* function exit code */
20141 37 : goto __pyx_L0;
20142 1 : __pyx_L1_error:;
20143 1 : __pyx_r = NULL;
20144 38 : __pyx_L0:;
20145 38 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
20146 : {
20147 38 : Py_ssize_t __pyx_temp;
20148 38 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20149 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20150 : }
20151 : }
20152 : __Pyx_RefNannyFinishContext();
20153 : return __pyx_r;
20154 : }
20155 :
20156 37 : static PyObject *__pyx_pf_5scipy_6signal_19_peak_finding_utils__local_maxima_1d(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x) {
20157 37 : __Pyx_memviewslice __pyx_v_midpoints = { 0, 0, { 0 }, { 0 }, { 0 } };
20158 37 : __Pyx_memviewslice __pyx_v_left_edges = { 0, 0, { 0 }, { 0 }, { 0 } };
20159 37 : __Pyx_memviewslice __pyx_v_right_edges = { 0, 0, { 0 }, { 0 }, { 0 } };
20160 37 : __pyx_t_5numpy_intp_t __pyx_v_m;
20161 37 : __pyx_t_5numpy_intp_t __pyx_v_i;
20162 37 : __pyx_t_5numpy_intp_t __pyx_v_i_ahead;
20163 37 : __pyx_t_5numpy_intp_t __pyx_v_i_max;
20164 37 : PyObject *__pyx_r = NULL;
20165 : __Pyx_RefNannyDeclarations
20166 37 : PyObject *__pyx_t_1 = NULL;
20167 37 : PyObject *__pyx_t_2 = NULL;
20168 37 : PyObject *__pyx_t_3 = NULL;
20169 37 : PyObject *__pyx_t_4 = NULL;
20170 37 : PyObject *__pyx_t_5 = NULL;
20171 37 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
20172 37 : int __pyx_t_7;
20173 37 : Py_ssize_t __pyx_t_8;
20174 37 : Py_ssize_t __pyx_t_9;
20175 37 : int __pyx_t_10;
20176 37 : Py_ssize_t __pyx_t_11;
20177 37 : int __pyx_lineno = 0;
20178 37 : const char *__pyx_filename = NULL;
20179 37 : int __pyx_clineno = 0;
20180 37 : __Pyx_RefNannySetupContext("_local_maxima_1d", 1);
20181 :
20182 : /* "scipy/signal/_peak_finding_utils.pyx":56
20183 : *
20184 : * # Preallocate, there can't be more maxima than half the size of `x`
20185 : * midpoints = np.empty(x.shape[0] // 2, dtype=np.intp) # <<<<<<<<<<<<<<
20186 : * left_edges = np.empty(x.shape[0] // 2, dtype=np.intp)
20187 : * right_edges = np.empty(x.shape[0] // 2, dtype=np.intp)
20188 : */
20189 37 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
20190 37 : __Pyx_GOTREF(__pyx_t_1);
20191 37 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
20192 37 : __Pyx_GOTREF(__pyx_t_2);
20193 37 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20194 37 : __pyx_t_1 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t((__pyx_v_x.shape[0]), 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
20195 37 : __Pyx_GOTREF(__pyx_t_1);
20196 37 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
20197 37 : __Pyx_GOTREF(__pyx_t_3);
20198 37 : __Pyx_GIVEREF(__pyx_t_1);
20199 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error);
20200 37 : __pyx_t_1 = 0;
20201 37 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
20202 37 : __Pyx_GOTREF(__pyx_t_1);
20203 37 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
20204 37 : __Pyx_GOTREF(__pyx_t_4);
20205 37 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_intp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
20206 37 : __Pyx_GOTREF(__pyx_t_5);
20207 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20208 37 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
20209 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20210 37 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 56, __pyx_L1_error)
20211 37 : __Pyx_GOTREF(__pyx_t_5);
20212 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20213 37 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20214 37 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20215 37 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 56, __pyx_L1_error)
20216 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20217 37 : __pyx_v_midpoints = __pyx_t_6;
20218 37 : __pyx_t_6.memview = NULL;
20219 37 : __pyx_t_6.data = NULL;
20220 :
20221 : /* "scipy/signal/_peak_finding_utils.pyx":57
20222 : * # Preallocate, there can't be more maxima than half the size of `x`
20223 : * midpoints = np.empty(x.shape[0] // 2, dtype=np.intp)
20224 : * left_edges = np.empty(x.shape[0] // 2, dtype=np.intp) # <<<<<<<<<<<<<<
20225 : * right_edges = np.empty(x.shape[0] // 2, dtype=np.intp)
20226 : * m = 0 # Pointer to the end of valid area in allocated arrays
20227 : */
20228 37 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
20229 37 : __Pyx_GOTREF(__pyx_t_5);
20230 37 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
20231 37 : __Pyx_GOTREF(__pyx_t_1);
20232 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20233 37 : __pyx_t_5 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t((__pyx_v_x.shape[0]), 2)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
20234 37 : __Pyx_GOTREF(__pyx_t_5);
20235 37 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
20236 37 : __Pyx_GOTREF(__pyx_t_3);
20237 37 : __Pyx_GIVEREF(__pyx_t_5);
20238 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error);
20239 37 : __pyx_t_5 = 0;
20240 37 : __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
20241 37 : __Pyx_GOTREF(__pyx_t_5);
20242 37 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
20243 37 : __Pyx_GOTREF(__pyx_t_2);
20244 37 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
20245 37 : __Pyx_GOTREF(__pyx_t_4);
20246 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20247 37 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
20248 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20249 37 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
20250 37 : __Pyx_GOTREF(__pyx_t_4);
20251 37 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20252 37 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20253 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20254 37 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 57, __pyx_L1_error)
20255 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20256 37 : __pyx_v_left_edges = __pyx_t_6;
20257 37 : __pyx_t_6.memview = NULL;
20258 37 : __pyx_t_6.data = NULL;
20259 :
20260 : /* "scipy/signal/_peak_finding_utils.pyx":58
20261 : * midpoints = np.empty(x.shape[0] // 2, dtype=np.intp)
20262 : * left_edges = np.empty(x.shape[0] // 2, dtype=np.intp)
20263 : * right_edges = np.empty(x.shape[0] // 2, dtype=np.intp) # <<<<<<<<<<<<<<
20264 : * m = 0 # Pointer to the end of valid area in allocated arrays
20265 : *
20266 : */
20267 37 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
20268 37 : __Pyx_GOTREF(__pyx_t_4);
20269 37 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 58, __pyx_L1_error)
20270 37 : __Pyx_GOTREF(__pyx_t_5);
20271 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20272 37 : __pyx_t_4 = PyInt_FromSsize_t(__Pyx_div_Py_ssize_t((__pyx_v_x.shape[0]), 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
20273 37 : __Pyx_GOTREF(__pyx_t_4);
20274 37 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
20275 37 : __Pyx_GOTREF(__pyx_t_3);
20276 37 : __Pyx_GIVEREF(__pyx_t_4);
20277 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error);
20278 37 : __pyx_t_4 = 0;
20279 37 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
20280 37 : __Pyx_GOTREF(__pyx_t_4);
20281 37 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
20282 37 : __Pyx_GOTREF(__pyx_t_1);
20283 37 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
20284 37 : __Pyx_GOTREF(__pyx_t_2);
20285 37 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20286 37 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
20287 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20288 37 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
20289 37 : __Pyx_GOTREF(__pyx_t_2);
20290 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20291 37 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20292 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20293 37 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 58, __pyx_L1_error)
20294 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20295 37 : __pyx_v_right_edges = __pyx_t_6;
20296 37 : __pyx_t_6.memview = NULL;
20297 37 : __pyx_t_6.data = NULL;
20298 :
20299 : /* "scipy/signal/_peak_finding_utils.pyx":59
20300 : * left_edges = np.empty(x.shape[0] // 2, dtype=np.intp)
20301 : * right_edges = np.empty(x.shape[0] // 2, dtype=np.intp)
20302 : * m = 0 # Pointer to the end of valid area in allocated arrays # <<<<<<<<<<<<<<
20303 : *
20304 : * with nogil:
20305 : */
20306 37 : __pyx_v_m = 0;
20307 :
20308 : /* "scipy/signal/_peak_finding_utils.pyx":61
20309 : * m = 0 # Pointer to the end of valid area in allocated arrays
20310 : *
20311 : * with nogil: # <<<<<<<<<<<<<<
20312 : * i = 1 # Pointer to current sample, first one can't be maxima
20313 : * i_max = x.shape[0] - 1 # Last sample can't be maxima
20314 : */
20315 : {
20316 : #ifdef WITH_THREAD
20317 37 : PyThreadState *_save;
20318 37 : _save = NULL;
20319 37 : Py_UNBLOCK_THREADS
20320 37 : __Pyx_FastGIL_Remember();
20321 : #endif
20322 : /*try:*/ {
20323 :
20324 : /* "scipy/signal/_peak_finding_utils.pyx":62
20325 : *
20326 : * with nogil:
20327 : * i = 1 # Pointer to current sample, first one can't be maxima # <<<<<<<<<<<<<<
20328 : * i_max = x.shape[0] - 1 # Last sample can't be maxima
20329 : * while i < i_max:
20330 : */
20331 37 : __pyx_v_i = 1;
20332 :
20333 : /* "scipy/signal/_peak_finding_utils.pyx":63
20334 : * with nogil:
20335 : * i = 1 # Pointer to current sample, first one can't be maxima
20336 : * i_max = x.shape[0] - 1 # Last sample can't be maxima # <<<<<<<<<<<<<<
20337 : * while i < i_max:
20338 : * # Test if previous sample is smaller
20339 : */
20340 37 : __pyx_v_i_max = ((__pyx_v_x.shape[0]) - 1);
20341 :
20342 : /* "scipy/signal/_peak_finding_utils.pyx":64
20343 : * i = 1 # Pointer to current sample, first one can't be maxima
20344 : * i_max = x.shape[0] - 1 # Last sample can't be maxima
20345 : * while i < i_max: # <<<<<<<<<<<<<<
20346 : * # Test if previous sample is smaller
20347 : * if x[i - 1] < x[i]:
20348 : */
20349 733 : while (1) {
20350 385 : __pyx_t_7 = (__pyx_v_i < __pyx_v_i_max);
20351 385 : if (!__pyx_t_7) break;
20352 :
20353 : /* "scipy/signal/_peak_finding_utils.pyx":66
20354 : * while i < i_max:
20355 : * # Test if previous sample is smaller
20356 : * if x[i - 1] < x[i]: # <<<<<<<<<<<<<<
20357 : * i_ahead = i + 1 # Index to look ahead of current sample
20358 : *
20359 : */
20360 348 : __pyx_t_8 = (__pyx_v_i - 1);
20361 348 : __pyx_t_9 = __pyx_v_i;
20362 348 : __pyx_t_7 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_8)) ))) < (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_9)) ))));
20363 348 : if (__pyx_t_7) {
20364 :
20365 : /* "scipy/signal/_peak_finding_utils.pyx":67
20366 : * # Test if previous sample is smaller
20367 : * if x[i - 1] < x[i]:
20368 : * i_ahead = i + 1 # Index to look ahead of current sample # <<<<<<<<<<<<<<
20369 : *
20370 : * # Find next sample that is unequal to x[i]
20371 : */
20372 317 : __pyx_v_i_ahead = (__pyx_v_i + 1);
20373 :
20374 : /* "scipy/signal/_peak_finding_utils.pyx":70
20375 : *
20376 : * # Find next sample that is unequal to x[i]
20377 : * while i_ahead < i_max and x[i_ahead] == x[i]: # <<<<<<<<<<<<<<
20378 : * i_ahead += 1
20379 : *
20380 : */
20381 1479 : while (1) {
20382 898 : __pyx_t_10 = (__pyx_v_i_ahead < __pyx_v_i_max);
20383 898 : if (__pyx_t_10) {
20384 866 : } else {
20385 32 : __pyx_t_7 = __pyx_t_10;
20386 32 : goto __pyx_L11_bool_binop_done;
20387 : }
20388 866 : __pyx_t_9 = __pyx_v_i_ahead;
20389 866 : __pyx_t_8 = __pyx_v_i;
20390 866 : __pyx_t_10 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_9)) ))) == (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_8)) ))));
20391 866 : __pyx_t_7 = __pyx_t_10;
20392 898 : __pyx_L11_bool_binop_done:;
20393 898 : if (!__pyx_t_7) break;
20394 :
20395 : /* "scipy/signal/_peak_finding_utils.pyx":71
20396 : * # Find next sample that is unequal to x[i]
20397 : * while i_ahead < i_max and x[i_ahead] == x[i]:
20398 : * i_ahead += 1 # <<<<<<<<<<<<<<
20399 : *
20400 : * # Maxima is found if next unequal sample is smaller than x[i]
20401 : */
20402 581 : __pyx_v_i_ahead = (__pyx_v_i_ahead + 1);
20403 : }
20404 :
20405 : /* "scipy/signal/_peak_finding_utils.pyx":74
20406 : *
20407 : * # Maxima is found if next unequal sample is smaller than x[i]
20408 : * if x[i_ahead] < x[i]: # <<<<<<<<<<<<<<
20409 : * left_edges[m] = i
20410 : * right_edges[m] = i_ahead - 1
20411 : */
20412 317 : __pyx_t_8 = __pyx_v_i_ahead;
20413 317 : __pyx_t_9 = __pyx_v_i;
20414 317 : __pyx_t_7 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_8)) ))) < (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_9)) ))));
20415 317 : if (__pyx_t_7) {
20416 :
20417 : /* "scipy/signal/_peak_finding_utils.pyx":75
20418 : * # Maxima is found if next unequal sample is smaller than x[i]
20419 : * if x[i_ahead] < x[i]:
20420 : * left_edges[m] = i # <<<<<<<<<<<<<<
20421 : * right_edges[m] = i_ahead - 1
20422 : * midpoints[m] = (left_edges[m] + right_edges[m]) // 2
20423 : */
20424 144 : __pyx_t_9 = __pyx_v_m;
20425 144 : *((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_left_edges.data) + __pyx_t_9)) )) = __pyx_v_i;
20426 :
20427 : /* "scipy/signal/_peak_finding_utils.pyx":76
20428 : * if x[i_ahead] < x[i]:
20429 : * left_edges[m] = i
20430 : * right_edges[m] = i_ahead - 1 # <<<<<<<<<<<<<<
20431 : * midpoints[m] = (left_edges[m] + right_edges[m]) // 2
20432 : * m += 1
20433 : */
20434 144 : __pyx_t_9 = __pyx_v_m;
20435 144 : *((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_right_edges.data) + __pyx_t_9)) )) = (__pyx_v_i_ahead - 1);
20436 :
20437 : /* "scipy/signal/_peak_finding_utils.pyx":77
20438 : * left_edges[m] = i
20439 : * right_edges[m] = i_ahead - 1
20440 : * midpoints[m] = (left_edges[m] + right_edges[m]) // 2 # <<<<<<<<<<<<<<
20441 : * m += 1
20442 : * # Skip samples that can't be maximum
20443 : */
20444 144 : __pyx_t_9 = __pyx_v_m;
20445 144 : __pyx_t_8 = __pyx_v_m;
20446 144 : __pyx_t_11 = __pyx_v_m;
20447 144 : *((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_midpoints.data) + __pyx_t_11)) )) = __Pyx_div___pyx_t_5numpy_intp_t(((*((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_left_edges.data) + __pyx_t_9)) ))) + (*((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_right_edges.data) + __pyx_t_8)) )))), 2);
20448 :
20449 : /* "scipy/signal/_peak_finding_utils.pyx":78
20450 : * right_edges[m] = i_ahead - 1
20451 : * midpoints[m] = (left_edges[m] + right_edges[m]) // 2
20452 : * m += 1 # <<<<<<<<<<<<<<
20453 : * # Skip samples that can't be maximum
20454 : * i = i_ahead
20455 : */
20456 144 : __pyx_v_m = (__pyx_v_m + 1);
20457 :
20458 : /* "scipy/signal/_peak_finding_utils.pyx":80
20459 : * m += 1
20460 : * # Skip samples that can't be maximum
20461 : * i = i_ahead # <<<<<<<<<<<<<<
20462 : * i += 1
20463 : *
20464 : */
20465 144 : __pyx_v_i = __pyx_v_i_ahead;
20466 :
20467 : /* "scipy/signal/_peak_finding_utils.pyx":74
20468 : *
20469 : * # Maxima is found if next unequal sample is smaller than x[i]
20470 : * if x[i_ahead] < x[i]: # <<<<<<<<<<<<<<
20471 : * left_edges[m] = i
20472 : * right_edges[m] = i_ahead - 1
20473 : */
20474 : }
20475 :
20476 : /* "scipy/signal/_peak_finding_utils.pyx":66
20477 : * while i < i_max:
20478 : * # Test if previous sample is smaller
20479 : * if x[i - 1] < x[i]: # <<<<<<<<<<<<<<
20480 : * i_ahead = i + 1 # Index to look ahead of current sample
20481 : *
20482 : */
20483 : }
20484 :
20485 : /* "scipy/signal/_peak_finding_utils.pyx":81
20486 : * # Skip samples that can't be maximum
20487 : * i = i_ahead
20488 : * i += 1 # <<<<<<<<<<<<<<
20489 : *
20490 : * # Keep only valid part of array memory.
20491 : */
20492 348 : __pyx_v_i = (__pyx_v_i + 1);
20493 : }
20494 : }
20495 :
20496 : /* "scipy/signal/_peak_finding_utils.pyx":61
20497 : * m = 0 # Pointer to the end of valid area in allocated arrays
20498 : *
20499 : * with nogil: # <<<<<<<<<<<<<<
20500 : * i = 1 # Pointer to current sample, first one can't be maxima
20501 : * i_max = x.shape[0] - 1 # Last sample can't be maxima
20502 : */
20503 : /*finally:*/ {
20504 : /*normal exit:*/{
20505 : #ifdef WITH_THREAD
20506 37 : __Pyx_FastGIL_Forget();
20507 37 : Py_BLOCK_THREADS
20508 : #endif
20509 37 : goto __pyx_L5;
20510 : }
20511 37 : __pyx_L5:;
20512 : }
20513 : }
20514 :
20515 : /* "scipy/signal/_peak_finding_utils.pyx":84
20516 : *
20517 : * # Keep only valid part of array memory.
20518 : * midpoints.base.resize(m, refcheck=False) # <<<<<<<<<<<<<<
20519 : * left_edges.base.resize(m, refcheck=False)
20520 : * right_edges.base.resize(m, refcheck=False)
20521 : */
20522 37 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_midpoints, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
20523 37 : __Pyx_GOTREF(__pyx_t_2);
20524 37 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
20525 37 : __Pyx_GOTREF(__pyx_t_4);
20526 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20527 37 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
20528 37 : __Pyx_GOTREF(__pyx_t_2);
20529 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20530 37 : __pyx_t_4 = __Pyx_PyInt_From_npy_intp(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
20531 37 : __Pyx_GOTREF(__pyx_t_4);
20532 37 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 84, __pyx_L1_error)
20533 37 : __Pyx_GOTREF(__pyx_t_3);
20534 37 : __Pyx_GIVEREF(__pyx_t_4);
20535 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error);
20536 37 : __pyx_t_4 = 0;
20537 37 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
20538 37 : __Pyx_GOTREF(__pyx_t_4);
20539 37 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
20540 37 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
20541 37 : __Pyx_GOTREF(__pyx_t_5);
20542 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20543 37 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20544 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20545 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20546 :
20547 : /* "scipy/signal/_peak_finding_utils.pyx":85
20548 : * # Keep only valid part of array memory.
20549 : * midpoints.base.resize(m, refcheck=False)
20550 : * left_edges.base.resize(m, refcheck=False) # <<<<<<<<<<<<<<
20551 : * right_edges.base.resize(m, refcheck=False)
20552 : *
20553 : */
20554 37 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_left_edges, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
20555 37 : __Pyx_GOTREF(__pyx_t_5);
20556 37 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
20557 37 : __Pyx_GOTREF(__pyx_t_4);
20558 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20559 37 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
20560 37 : __Pyx_GOTREF(__pyx_t_5);
20561 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20562 37 : __pyx_t_4 = __Pyx_PyInt_From_npy_intp(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
20563 37 : __Pyx_GOTREF(__pyx_t_4);
20564 37 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
20565 37 : __Pyx_GOTREF(__pyx_t_3);
20566 37 : __Pyx_GIVEREF(__pyx_t_4);
20567 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error);
20568 37 : __pyx_t_4 = 0;
20569 37 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 85, __pyx_L1_error)
20570 37 : __Pyx_GOTREF(__pyx_t_4);
20571 37 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
20572 37 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 85, __pyx_L1_error)
20573 37 : __Pyx_GOTREF(__pyx_t_2);
20574 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20575 37 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20576 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20577 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20578 :
20579 : /* "scipy/signal/_peak_finding_utils.pyx":86
20580 : * midpoints.base.resize(m, refcheck=False)
20581 : * left_edges.base.resize(m, refcheck=False)
20582 : * right_edges.base.resize(m, refcheck=False) # <<<<<<<<<<<<<<
20583 : *
20584 : * return midpoints.base, left_edges.base, right_edges.base
20585 : */
20586 37 : __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_right_edges, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
20587 37 : __Pyx_GOTREF(__pyx_t_2);
20588 37 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
20589 37 : __Pyx_GOTREF(__pyx_t_4);
20590 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20591 37 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_resize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
20592 37 : __Pyx_GOTREF(__pyx_t_2);
20593 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20594 37 : __pyx_t_4 = __Pyx_PyInt_From_npy_intp(__pyx_v_m); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
20595 37 : __Pyx_GOTREF(__pyx_t_4);
20596 37 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
20597 37 : __Pyx_GOTREF(__pyx_t_3);
20598 37 : __Pyx_GIVEREF(__pyx_t_4);
20599 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error);
20600 37 : __pyx_t_4 = 0;
20601 37 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
20602 37 : __Pyx_GOTREF(__pyx_t_4);
20603 37 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_refcheck, Py_False) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
20604 37 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
20605 37 : __Pyx_GOTREF(__pyx_t_5);
20606 37 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20607 37 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20608 37 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20609 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20610 :
20611 : /* "scipy/signal/_peak_finding_utils.pyx":88
20612 : * right_edges.base.resize(m, refcheck=False)
20613 : *
20614 : * return midpoints.base, left_edges.base, right_edges.base # <<<<<<<<<<<<<<
20615 : *
20616 : *
20617 : */
20618 37 : __Pyx_XDECREF(__pyx_r);
20619 37 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_midpoints, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
20620 37 : __Pyx_GOTREF(__pyx_t_5);
20621 37 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
20622 37 : __Pyx_GOTREF(__pyx_t_4);
20623 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20624 37 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_left_edges, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
20625 37 : __Pyx_GOTREF(__pyx_t_5);
20626 37 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
20627 37 : __Pyx_GOTREF(__pyx_t_3);
20628 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20629 37 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_right_edges, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
20630 37 : __Pyx_GOTREF(__pyx_t_5);
20631 37 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
20632 37 : __Pyx_GOTREF(__pyx_t_2);
20633 37 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20634 37 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
20635 37 : __Pyx_GOTREF(__pyx_t_5);
20636 37 : __Pyx_GIVEREF(__pyx_t_4);
20637 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error);
20638 37 : __Pyx_GIVEREF(__pyx_t_3);
20639 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error);
20640 37 : __Pyx_GIVEREF(__pyx_t_2);
20641 37 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error);
20642 37 : __pyx_t_4 = 0;
20643 37 : __pyx_t_3 = 0;
20644 37 : __pyx_t_2 = 0;
20645 37 : __pyx_r = __pyx_t_5;
20646 37 : __pyx_t_5 = 0;
20647 37 : goto __pyx_L0;
20648 :
20649 : /* "scipy/signal/_peak_finding_utils.pyx":20
20650 : *
20651 : *
20652 : * def _local_maxima_1d(const np.float64_t[::1] x not None): # <<<<<<<<<<<<<<
20653 : * """
20654 : * Find local maxima in a 1D array.
20655 : */
20656 :
20657 : /* function exit code */
20658 0 : __pyx_L1_error:;
20659 0 : __Pyx_XDECREF(__pyx_t_1);
20660 0 : __Pyx_XDECREF(__pyx_t_2);
20661 0 : __Pyx_XDECREF(__pyx_t_3);
20662 0 : __Pyx_XDECREF(__pyx_t_4);
20663 0 : __Pyx_XDECREF(__pyx_t_5);
20664 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
20665 0 : __Pyx_AddTraceback("scipy.signal._peak_finding_utils._local_maxima_1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
20666 0 : __pyx_r = NULL;
20667 37 : __pyx_L0:;
20668 37 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_midpoints, 1);
20669 37 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_left_edges, 1);
20670 37 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_right_edges, 1);
20671 37 : __Pyx_XGIVEREF(__pyx_r);
20672 37 : __Pyx_RefNannyFinishContext();
20673 37 : return __pyx_r;
20674 : }
20675 :
20676 : /* "scipy/signal/_peak_finding_utils.pyx":91
20677 : *
20678 : *
20679 : * def _select_by_peak_distance(const np.intp_t[::1] peaks not None, # <<<<<<<<<<<<<<
20680 : * const np.float64_t[::1] priority not None,
20681 : * np.float64_t distance):
20682 : */
20683 :
20684 : /* Python wrapper */
20685 : static PyObject *__pyx_pw_5scipy_6signal_19_peak_finding_utils_3_select_by_peak_distance(PyObject *__pyx_self,
20686 : #if CYTHON_METH_FASTCALL
20687 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20688 : #else
20689 : PyObject *__pyx_args, PyObject *__pyx_kwds
20690 : #endif
20691 : ); /*proto*/
20692 : PyDoc_STRVAR(__pyx_doc_5scipy_6signal_19_peak_finding_utils_2_select_by_peak_distance, "\n Evaluate which peaks fulfill the distance condition.\n\n Parameters\n ----------\n peaks : ndarray\n Indices of peaks in `vector`.\n priority : ndarray\n An array matching `peaks` used to determine priority of each peak. A\n peak with a higher priority value is kept over one with a lower one.\n distance : np.float64\n Minimal distance that peaks must be spaced.\n\n Returns\n -------\n keep : ndarray[bool]\n A boolean mask evaluating to true where `peaks` fulfill the distance\n condition.\n\n Notes\n -----\n Declaring the input arrays as C-contiguous doesn't seem to have performance\n advantages.\n\n .. versionadded:: 1.1.0\n ");
20693 : static PyMethodDef __pyx_mdef_5scipy_6signal_19_peak_finding_utils_3_select_by_peak_distance = {"_select_by_peak_distance", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6signal_19_peak_finding_utils_3_select_by_peak_distance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6signal_19_peak_finding_utils_2_select_by_peak_distance};
20694 4 : static PyObject *__pyx_pw_5scipy_6signal_19_peak_finding_utils_3_select_by_peak_distance(PyObject *__pyx_self,
20695 : #if CYTHON_METH_FASTCALL
20696 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
20697 : #else
20698 : PyObject *__pyx_args, PyObject *__pyx_kwds
20699 : #endif
20700 : ) {
20701 4 : __Pyx_memviewslice __pyx_v_peaks = { 0, 0, { 0 }, { 0 }, { 0 } };
20702 4 : __Pyx_memviewslice __pyx_v_priority = { 0, 0, { 0 }, { 0 }, { 0 } };
20703 4 : __pyx_t_5numpy_float64_t __pyx_v_distance;
20704 : #if !CYTHON_METH_FASTCALL
20705 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
20706 : #endif
20707 4 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
20708 4 : PyObject* values[3] = {0,0,0};
20709 4 : int __pyx_lineno = 0;
20710 4 : const char *__pyx_filename = NULL;
20711 4 : int __pyx_clineno = 0;
20712 4 : PyObject *__pyx_r = 0;
20713 : __Pyx_RefNannyDeclarations
20714 4 : __Pyx_RefNannySetupContext("_select_by_peak_distance (wrapper)", 0);
20715 : #if !CYTHON_METH_FASTCALL
20716 : #if CYTHON_ASSUME_SAFE_MACROS
20717 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
20718 : #else
20719 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
20720 : #endif
20721 : #endif
20722 4 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
20723 : {
20724 4 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_peaks,&__pyx_n_s_priority,&__pyx_n_s_distance,0};
20725 4 : if (__pyx_kwds) {
20726 0 : Py_ssize_t kw_args;
20727 0 : switch (__pyx_nargs) {
20728 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
20729 0 : CYTHON_FALLTHROUGH;
20730 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20731 0 : CYTHON_FALLTHROUGH;
20732 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20733 0 : CYTHON_FALLTHROUGH;
20734 0 : case 0: break;
20735 0 : default: goto __pyx_L5_argtuple_error;
20736 : }
20737 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
20738 0 : switch (__pyx_nargs) {
20739 0 : case 0:
20740 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_peaks)) != 0)) {
20741 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
20742 0 : kw_args--;
20743 : }
20744 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
20745 0 : else goto __pyx_L5_argtuple_error;
20746 0 : CYTHON_FALLTHROUGH;
20747 : case 1:
20748 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_priority)) != 0)) {
20749 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
20750 0 : kw_args--;
20751 : }
20752 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
20753 : else {
20754 0 : __Pyx_RaiseArgtupleInvalid("_select_by_peak_distance", 1, 3, 3, 1); __PYX_ERR(0, 91, __pyx_L3_error)
20755 : }
20756 0 : CYTHON_FALLTHROUGH;
20757 : case 2:
20758 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_distance)) != 0)) {
20759 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
20760 0 : kw_args--;
20761 : }
20762 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L3_error)
20763 : else {
20764 0 : __Pyx_RaiseArgtupleInvalid("_select_by_peak_distance", 1, 3, 3, 2); __PYX_ERR(0, 91, __pyx_L3_error)
20765 : }
20766 : }
20767 0 : if (unlikely(kw_args > 0)) {
20768 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
20769 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_select_by_peak_distance") < 0)) __PYX_ERR(0, 91, __pyx_L3_error)
20770 : }
20771 4 : } else if (unlikely(__pyx_nargs != 3)) {
20772 0 : goto __pyx_L5_argtuple_error;
20773 : } else {
20774 4 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
20775 4 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
20776 4 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
20777 : }
20778 4 : __pyx_v_peaks = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t__const__(values[0], 0); if (unlikely(!__pyx_v_peaks.memview)) __PYX_ERR(0, 91, __pyx_L3_error)
20779 4 : __pyx_v_priority = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t__const__(values[1], 0); if (unlikely(!__pyx_v_priority.memview)) __PYX_ERR(0, 92, __pyx_L3_error)
20780 4 : __pyx_v_distance = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_distance == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L3_error)
20781 : }
20782 4 : goto __pyx_L6_skip;
20783 0 : __pyx_L5_argtuple_error:;
20784 0 : __Pyx_RaiseArgtupleInvalid("_select_by_peak_distance", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 91, __pyx_L3_error)
20785 4 : __pyx_L6_skip:;
20786 4 : goto __pyx_L4_argument_unpacking_done;
20787 0 : __pyx_L3_error:;
20788 : {
20789 0 : Py_ssize_t __pyx_temp;
20790 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20791 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20792 : }
20793 : }
20794 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_peaks, 1);
20795 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_priority, 1);
20796 0 : __Pyx_AddTraceback("scipy.signal._peak_finding_utils._select_by_peak_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
20797 0 : __Pyx_RefNannyFinishContext();
20798 0 : return NULL;
20799 4 : __pyx_L4_argument_unpacking_done:;
20800 4 : if (unlikely(((PyObject *)__pyx_v_peaks.memview) == Py_None)) {
20801 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "peaks"); __PYX_ERR(0, 91, __pyx_L1_error)
20802 : }
20803 4 : if (unlikely(((PyObject *)__pyx_v_priority.memview) == Py_None)) {
20804 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "priority"); __PYX_ERR(0, 92, __pyx_L1_error)
20805 : }
20806 4 : __pyx_r = __pyx_pf_5scipy_6signal_19_peak_finding_utils_2_select_by_peak_distance(__pyx_self, __pyx_v_peaks, __pyx_v_priority, __pyx_v_distance);
20807 :
20808 : /* function exit code */
20809 4 : goto __pyx_L0;
20810 : __pyx_L1_error:;
20811 : __pyx_r = NULL;
20812 4 : __pyx_L0:;
20813 4 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_peaks, 1);
20814 4 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_priority, 1);
20815 : {
20816 4 : Py_ssize_t __pyx_temp;
20817 4 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
20818 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
20819 : }
20820 : }
20821 : __Pyx_RefNannyFinishContext();
20822 : return __pyx_r;
20823 : }
20824 :
20825 4 : static PyObject *__pyx_pf_5scipy_6signal_19_peak_finding_utils_2_select_by_peak_distance(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_peaks, __Pyx_memviewslice __pyx_v_priority, __pyx_t_5numpy_float64_t __pyx_v_distance) {
20826 4 : __Pyx_memviewslice __pyx_v_keep = { 0, 0, { 0 }, { 0 }, { 0 } };
20827 4 : __Pyx_memviewslice __pyx_v_priority_to_position = { 0, 0, { 0 }, { 0 }, { 0 } };
20828 4 : __pyx_t_5numpy_intp_t __pyx_v_i;
20829 4 : __pyx_t_5numpy_intp_t __pyx_v_j;
20830 4 : __pyx_t_5numpy_intp_t __pyx_v_k;
20831 4 : __pyx_t_5numpy_intp_t __pyx_v_peaks_size;
20832 4 : __pyx_t_5numpy_intp_t __pyx_v_distance_;
20833 4 : PyObject *__pyx_r = NULL;
20834 : __Pyx_RefNannyDeclarations
20835 4 : PyObject *__pyx_t_1 = NULL;
20836 4 : PyObject *__pyx_t_2 = NULL;
20837 4 : PyObject *__pyx_t_3 = NULL;
20838 4 : PyObject *__pyx_t_4 = NULL;
20839 4 : PyObject *__pyx_t_5 = NULL;
20840 4 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
20841 4 : unsigned int __pyx_t_7;
20842 4 : __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
20843 4 : __pyx_t_5numpy_intp_t __pyx_t_9;
20844 4 : Py_ssize_t __pyx_t_10;
20845 4 : int __pyx_t_11;
20846 4 : int __pyx_t_12;
20847 4 : Py_ssize_t __pyx_t_13;
20848 4 : int __pyx_lineno = 0;
20849 4 : const char *__pyx_filename = NULL;
20850 4 : int __pyx_clineno = 0;
20851 4 : __Pyx_RefNannySetupContext("_select_by_peak_distance", 1);
20852 :
20853 : /* "scipy/signal/_peak_finding_utils.pyx":125
20854 : * np.intp_t i, j, k, peaks_size, distance_
20855 : *
20856 : * peaks_size = peaks.shape[0] # <<<<<<<<<<<<<<
20857 : * # Round up because actual peak distance can only be natural number
20858 : * distance_ = <np.intp_t>ceil(distance)
20859 : */
20860 4 : __pyx_v_peaks_size = (__pyx_v_peaks.shape[0]);
20861 :
20862 : /* "scipy/signal/_peak_finding_utils.pyx":127
20863 : * peaks_size = peaks.shape[0]
20864 : * # Round up because actual peak distance can only be natural number
20865 : * distance_ = <np.intp_t>ceil(distance) # <<<<<<<<<<<<<<
20866 : * keep = np.ones(peaks_size, dtype=np.uint8) # Prepare array of flags
20867 : *
20868 : */
20869 4 : __pyx_v_distance_ = ((__pyx_t_5numpy_intp_t)ceil(__pyx_v_distance));
20870 :
20871 : /* "scipy/signal/_peak_finding_utils.pyx":128
20872 : * # Round up because actual peak distance can only be natural number
20873 : * distance_ = <np.intp_t>ceil(distance)
20874 : * keep = np.ones(peaks_size, dtype=np.uint8) # Prepare array of flags # <<<<<<<<<<<<<<
20875 : *
20876 : * # Create map from `i` (index for `peaks` sorted by `priority`) to `j` (index
20877 : */
20878 4 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
20879 4 : __Pyx_GOTREF(__pyx_t_1);
20880 4 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ones); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
20881 4 : __Pyx_GOTREF(__pyx_t_2);
20882 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20883 4 : __pyx_t_1 = __Pyx_PyInt_From_npy_intp(__pyx_v_peaks_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
20884 4 : __Pyx_GOTREF(__pyx_t_1);
20885 4 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
20886 4 : __Pyx_GOTREF(__pyx_t_3);
20887 4 : __Pyx_GIVEREF(__pyx_t_1);
20888 4 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error);
20889 4 : __pyx_t_1 = 0;
20890 4 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
20891 4 : __Pyx_GOTREF(__pyx_t_1);
20892 4 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
20893 4 : __Pyx_GOTREF(__pyx_t_4);
20894 4 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
20895 4 : __Pyx_GOTREF(__pyx_t_5);
20896 4 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20897 4 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
20898 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20899 4 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error)
20900 4 : __Pyx_GOTREF(__pyx_t_5);
20901 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20902 4 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20903 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20904 4 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 128, __pyx_L1_error)
20905 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20906 4 : __pyx_v_keep = __pyx_t_6;
20907 4 : __pyx_t_6.memview = NULL;
20908 4 : __pyx_t_6.data = NULL;
20909 :
20910 : /* "scipy/signal/_peak_finding_utils.pyx":134
20911 : * # with `j` by order of `priority` while still maintaining the ability to
20912 : * # step to neighbouring peaks with (`j` + 1) or (`j` - 1).
20913 : * priority_to_position = np.argsort(priority) # <<<<<<<<<<<<<<
20914 : *
20915 : * with nogil:
20916 : */
20917 4 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
20918 4 : __Pyx_GOTREF(__pyx_t_1);
20919 4 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_argsort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
20920 4 : __Pyx_GOTREF(__pyx_t_3);
20921 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20922 4 : __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_priority, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t__const__, (int (*)(char *, PyObject *)) NULL, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
20923 4 : __Pyx_GOTREF(__pyx_t_1);
20924 4 : __pyx_t_2 = NULL;
20925 4 : __pyx_t_7 = 0;
20926 : #if CYTHON_UNPACK_METHODS
20927 4 : if (unlikely(PyMethod_Check(__pyx_t_3))) {
20928 0 : __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
20929 0 : if (likely(__pyx_t_2)) {
20930 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
20931 0 : __Pyx_INCREF(__pyx_t_2);
20932 0 : __Pyx_INCREF(function);
20933 0 : __Pyx_DECREF_SET(__pyx_t_3, function);
20934 : __pyx_t_7 = 1;
20935 : }
20936 : }
20937 : #endif
20938 : {
20939 4 : PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_1};
20940 4 : __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
20941 4 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
20942 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20943 4 : if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error)
20944 4 : __Pyx_GOTREF(__pyx_t_5);
20945 4 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20946 : }
20947 4 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 134, __pyx_L1_error)
20948 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20949 4 : __pyx_v_priority_to_position = __pyx_t_8;
20950 4 : __pyx_t_8.memview = NULL;
20951 4 : __pyx_t_8.data = NULL;
20952 :
20953 : /* "scipy/signal/_peak_finding_utils.pyx":136
20954 : * priority_to_position = np.argsort(priority)
20955 : *
20956 : * with nogil: # <<<<<<<<<<<<<<
20957 : * # Highest priority first -> iterate in reverse order (decreasing)
20958 : * for i in range(peaks_size - 1, -1, -1):
20959 : */
20960 : {
20961 : #ifdef WITH_THREAD
20962 4 : PyThreadState *_save;
20963 4 : _save = NULL;
20964 4 : Py_UNBLOCK_THREADS
20965 4 : __Pyx_FastGIL_Remember();
20966 : #endif
20967 : /*try:*/ {
20968 :
20969 : /* "scipy/signal/_peak_finding_utils.pyx":138
20970 : * with nogil:
20971 : * # Highest priority first -> iterate in reverse order (decreasing)
20972 : * for i in range(peaks_size - 1, -1, -1): # <<<<<<<<<<<<<<
20973 : * # "Translate" `i` to `j` which points to current peak whose
20974 : * # neighbours are to be evaluated
20975 : */
20976 20 : for (__pyx_t_9 = (__pyx_v_peaks_size - 1); __pyx_t_9 > -1L; __pyx_t_9-=1) {
20977 16 : __pyx_v_i = __pyx_t_9;
20978 :
20979 : /* "scipy/signal/_peak_finding_utils.pyx":141
20980 : * # "Translate" `i` to `j` which points to current peak whose
20981 : * # neighbours are to be evaluated
20982 : * j = priority_to_position[i] # <<<<<<<<<<<<<<
20983 : * if keep[j] == 0:
20984 : * # Skip evaluation for peak already marked as "don't keep"
20985 : */
20986 16 : __pyx_t_10 = __pyx_v_i;
20987 16 : __pyx_v_j = (*((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_priority_to_position.data) + __pyx_t_10)) )));
20988 :
20989 : /* "scipy/signal/_peak_finding_utils.pyx":142
20990 : * # neighbours are to be evaluated
20991 : * j = priority_to_position[i]
20992 : * if keep[j] == 0: # <<<<<<<<<<<<<<
20993 : * # Skip evaluation for peak already marked as "don't keep"
20994 : * continue
20995 : */
20996 16 : __pyx_t_10 = __pyx_v_j;
20997 16 : __pyx_t_11 = ((*((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_keep.data) + __pyx_t_10)) ))) == 0);
20998 16 : if (__pyx_t_11) {
20999 :
21000 : /* "scipy/signal/_peak_finding_utils.pyx":144
21001 : * if keep[j] == 0:
21002 : * # Skip evaluation for peak already marked as "don't keep"
21003 : * continue # <<<<<<<<<<<<<<
21004 : *
21005 : * k = j - 1
21006 : */
21007 4 : goto __pyx_L6_continue;
21008 :
21009 : /* "scipy/signal/_peak_finding_utils.pyx":142
21010 : * # neighbours are to be evaluated
21011 : * j = priority_to_position[i]
21012 : * if keep[j] == 0: # <<<<<<<<<<<<<<
21013 : * # Skip evaluation for peak already marked as "don't keep"
21014 : * continue
21015 : */
21016 : }
21017 :
21018 : /* "scipy/signal/_peak_finding_utils.pyx":146
21019 : * continue
21020 : *
21021 : * k = j - 1 # <<<<<<<<<<<<<<
21022 : * # Flag "earlier" peaks for removal until minimal distance is exceeded
21023 : * while 0 <= k and peaks[j] - peaks[k] < distance_:
21024 : */
21025 12 : __pyx_v_k = (__pyx_v_j - 1);
21026 :
21027 : /* "scipy/signal/_peak_finding_utils.pyx":148
21028 : * k = j - 1
21029 : * # Flag "earlier" peaks for removal until minimal distance is exceeded
21030 : * while 0 <= k and peaks[j] - peaks[k] < distance_: # <<<<<<<<<<<<<<
21031 : * keep[k] = 0
21032 : * k -= 1
21033 : */
21034 18 : while (1) {
21035 15 : __pyx_t_12 = (0 <= __pyx_v_k);
21036 15 : if (__pyx_t_12) {
21037 12 : } else {
21038 3 : __pyx_t_11 = __pyx_t_12;
21039 3 : goto __pyx_L11_bool_binop_done;
21040 : }
21041 12 : __pyx_t_10 = __pyx_v_j;
21042 12 : __pyx_t_13 = __pyx_v_k;
21043 12 : __pyx_t_12 = (((*((__pyx_t_5numpy_intp_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t const *) __pyx_v_peaks.data) + __pyx_t_10)) ))) - (*((__pyx_t_5numpy_intp_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t const *) __pyx_v_peaks.data) + __pyx_t_13)) )))) < __pyx_v_distance_);
21044 12 : __pyx_t_11 = __pyx_t_12;
21045 15 : __pyx_L11_bool_binop_done:;
21046 15 : if (!__pyx_t_11) break;
21047 :
21048 : /* "scipy/signal/_peak_finding_utils.pyx":149
21049 : * # Flag "earlier" peaks for removal until minimal distance is exceeded
21050 : * while 0 <= k and peaks[j] - peaks[k] < distance_:
21051 : * keep[k] = 0 # <<<<<<<<<<<<<<
21052 : * k -= 1
21053 : *
21054 : */
21055 3 : __pyx_t_13 = __pyx_v_k;
21056 3 : *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_keep.data) + __pyx_t_13)) )) = 0;
21057 :
21058 : /* "scipy/signal/_peak_finding_utils.pyx":150
21059 : * while 0 <= k and peaks[j] - peaks[k] < distance_:
21060 : * keep[k] = 0
21061 : * k -= 1 # <<<<<<<<<<<<<<
21062 : *
21063 : * k = j + 1
21064 : */
21065 3 : __pyx_v_k = (__pyx_v_k - 1);
21066 : }
21067 :
21068 : /* "scipy/signal/_peak_finding_utils.pyx":152
21069 : * k -= 1
21070 : *
21071 : * k = j + 1 # <<<<<<<<<<<<<<
21072 : * # Flag "later" peaks for removal until minimal distance is exceeded
21073 : * while k < peaks_size and peaks[k] - peaks[j] < distance_:
21074 : */
21075 12 : __pyx_v_k = (__pyx_v_j + 1);
21076 :
21077 : /* "scipy/signal/_peak_finding_utils.pyx":154
21078 : * k = j + 1
21079 : * # Flag "later" peaks for removal until minimal distance is exceeded
21080 : * while k < peaks_size and peaks[k] - peaks[j] < distance_: # <<<<<<<<<<<<<<
21081 : * keep[k] = 0
21082 : * k += 1
21083 : */
21084 20 : while (1) {
21085 16 : __pyx_t_12 = (__pyx_v_k < __pyx_v_peaks_size);
21086 16 : if (__pyx_t_12) {
21087 13 : } else {
21088 3 : __pyx_t_11 = __pyx_t_12;
21089 3 : goto __pyx_L15_bool_binop_done;
21090 : }
21091 13 : __pyx_t_13 = __pyx_v_k;
21092 13 : __pyx_t_10 = __pyx_v_j;
21093 13 : __pyx_t_12 = (((*((__pyx_t_5numpy_intp_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t const *) __pyx_v_peaks.data) + __pyx_t_13)) ))) - (*((__pyx_t_5numpy_intp_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t const *) __pyx_v_peaks.data) + __pyx_t_10)) )))) < __pyx_v_distance_);
21094 13 : __pyx_t_11 = __pyx_t_12;
21095 16 : __pyx_L15_bool_binop_done:;
21096 16 : if (!__pyx_t_11) break;
21097 :
21098 : /* "scipy/signal/_peak_finding_utils.pyx":155
21099 : * # Flag "later" peaks for removal until minimal distance is exceeded
21100 : * while k < peaks_size and peaks[k] - peaks[j] < distance_:
21101 : * keep[k] = 0 # <<<<<<<<<<<<<<
21102 : * k += 1
21103 : *
21104 : */
21105 4 : __pyx_t_10 = __pyx_v_k;
21106 4 : *((__pyx_t_5numpy_uint8_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_uint8_t *) __pyx_v_keep.data) + __pyx_t_10)) )) = 0;
21107 :
21108 : /* "scipy/signal/_peak_finding_utils.pyx":156
21109 : * while k < peaks_size and peaks[k] - peaks[j] < distance_:
21110 : * keep[k] = 0
21111 : * k += 1 # <<<<<<<<<<<<<<
21112 : *
21113 : * return keep.base.view(dtype=np.bool_) # Return as boolean array
21114 : */
21115 4 : __pyx_v_k = (__pyx_v_k + 1);
21116 : }
21117 16 : __pyx_L6_continue:;
21118 : }
21119 : }
21120 :
21121 : /* "scipy/signal/_peak_finding_utils.pyx":136
21122 : * priority_to_position = np.argsort(priority)
21123 : *
21124 : * with nogil: # <<<<<<<<<<<<<<
21125 : * # Highest priority first -> iterate in reverse order (decreasing)
21126 : * for i in range(peaks_size - 1, -1, -1):
21127 : */
21128 : /*finally:*/ {
21129 : /*normal exit:*/{
21130 : #ifdef WITH_THREAD
21131 4 : __Pyx_FastGIL_Forget();
21132 4 : Py_BLOCK_THREADS
21133 : #endif
21134 4 : goto __pyx_L5;
21135 : }
21136 4 : __pyx_L5:;
21137 : }
21138 : }
21139 :
21140 : /* "scipy/signal/_peak_finding_utils.pyx":158
21141 : * k += 1
21142 : *
21143 : * return keep.base.view(dtype=np.bool_) # Return as boolean array # <<<<<<<<<<<<<<
21144 : *
21145 : *
21146 : */
21147 4 : __Pyx_XDECREF(__pyx_r);
21148 4 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_keep, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_uint8_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_uint8_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
21149 4 : __Pyx_GOTREF(__pyx_t_5);
21150 4 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
21151 4 : __Pyx_GOTREF(__pyx_t_3);
21152 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21153 4 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_view); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
21154 4 : __Pyx_GOTREF(__pyx_t_5);
21155 4 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21156 4 : __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
21157 4 : __Pyx_GOTREF(__pyx_t_3);
21158 4 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
21159 4 : __Pyx_GOTREF(__pyx_t_1);
21160 4 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_bool); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
21161 4 : __Pyx_GOTREF(__pyx_t_2);
21162 4 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21163 4 : if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
21164 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21165 4 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
21166 4 : __Pyx_GOTREF(__pyx_t_2);
21167 4 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21168 4 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21169 4 : __pyx_r = __pyx_t_2;
21170 4 : __pyx_t_2 = 0;
21171 4 : goto __pyx_L0;
21172 :
21173 : /* "scipy/signal/_peak_finding_utils.pyx":91
21174 : *
21175 : *
21176 : * def _select_by_peak_distance(const np.intp_t[::1] peaks not None, # <<<<<<<<<<<<<<
21177 : * const np.float64_t[::1] priority not None,
21178 : * np.float64_t distance):
21179 : */
21180 :
21181 : /* function exit code */
21182 0 : __pyx_L1_error:;
21183 0 : __Pyx_XDECREF(__pyx_t_1);
21184 0 : __Pyx_XDECREF(__pyx_t_2);
21185 0 : __Pyx_XDECREF(__pyx_t_3);
21186 0 : __Pyx_XDECREF(__pyx_t_4);
21187 0 : __Pyx_XDECREF(__pyx_t_5);
21188 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
21189 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
21190 0 : __Pyx_AddTraceback("scipy.signal._peak_finding_utils._select_by_peak_distance", __pyx_clineno, __pyx_lineno, __pyx_filename);
21191 0 : __pyx_r = NULL;
21192 4 : __pyx_L0:;
21193 4 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_keep, 1);
21194 4 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_priority_to_position, 1);
21195 4 : __Pyx_XGIVEREF(__pyx_r);
21196 4 : __Pyx_RefNannyFinishContext();
21197 4 : return __pyx_r;
21198 : }
21199 :
21200 : /* "scipy/signal/_peak_finding_utils.pyx":166
21201 : *
21202 : *
21203 : * def _peak_prominences(const np.float64_t[::1] x not None, # <<<<<<<<<<<<<<
21204 : * const np.intp_t[::1] peaks not None,
21205 : * np.intp_t wlen):
21206 : */
21207 :
21208 : /* Python wrapper */
21209 : static PyObject *__pyx_pw_5scipy_6signal_19_peak_finding_utils_5_peak_prominences(PyObject *__pyx_self,
21210 : #if CYTHON_METH_FASTCALL
21211 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21212 : #else
21213 : PyObject *__pyx_args, PyObject *__pyx_kwds
21214 : #endif
21215 : ); /*proto*/
21216 : PyDoc_STRVAR(__pyx_doc_5scipy_6signal_19_peak_finding_utils_4_peak_prominences, "\n Calculate the prominence of each peak in a signal.\n\n Parameters\n ----------\n x : ndarray\n A signal with peaks.\n peaks : ndarray\n Indices of peaks in `x`.\n wlen : np.intp\n A window length in samples (see `peak_prominences`) which is rounded up\n to the nearest odd integer. If smaller than 2 the entire signal `x` is\n used.\n\n Returns\n -------\n prominences : ndarray\n The calculated prominences for each peak in `peaks`.\n left_bases, right_bases : ndarray\n The peaks' bases as indices in `x` to the left and right of each peak.\n\n Raises\n ------\n ValueError\n If a value in `peaks` is an invalid index for `x`.\n\n Warns\n -----\n PeakPropertyWarning\n If a prominence of 0 was calculated for any peak.\n\n Notes\n -----\n This is the inner function to `peak_prominences`.\n\n .. versionadded:: 1.1.0\n ");
21217 : static PyMethodDef __pyx_mdef_5scipy_6signal_19_peak_finding_utils_5_peak_prominences = {"_peak_prominences", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6signal_19_peak_finding_utils_5_peak_prominences, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6signal_19_peak_finding_utils_4_peak_prominences};
21218 47 : static PyObject *__pyx_pw_5scipy_6signal_19_peak_finding_utils_5_peak_prominences(PyObject *__pyx_self,
21219 : #if CYTHON_METH_FASTCALL
21220 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
21221 : #else
21222 : PyObject *__pyx_args, PyObject *__pyx_kwds
21223 : #endif
21224 : ) {
21225 47 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
21226 47 : __Pyx_memviewslice __pyx_v_peaks = { 0, 0, { 0 }, { 0 }, { 0 } };
21227 47 : __pyx_t_5numpy_intp_t __pyx_v_wlen;
21228 : #if !CYTHON_METH_FASTCALL
21229 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
21230 : #endif
21231 47 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
21232 47 : PyObject* values[3] = {0,0,0};
21233 47 : int __pyx_lineno = 0;
21234 47 : const char *__pyx_filename = NULL;
21235 47 : int __pyx_clineno = 0;
21236 47 : PyObject *__pyx_r = 0;
21237 : __Pyx_RefNannyDeclarations
21238 47 : __Pyx_RefNannySetupContext("_peak_prominences (wrapper)", 0);
21239 : #if !CYTHON_METH_FASTCALL
21240 : #if CYTHON_ASSUME_SAFE_MACROS
21241 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
21242 : #else
21243 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
21244 : #endif
21245 : #endif
21246 47 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
21247 : {
21248 47 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_peaks,&__pyx_n_s_wlen,0};
21249 47 : if (__pyx_kwds) {
21250 7 : Py_ssize_t kw_args;
21251 7 : switch (__pyx_nargs) {
21252 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
21253 7 : CYTHON_FALLTHROUGH;
21254 7 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21255 7 : CYTHON_FALLTHROUGH;
21256 7 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21257 7 : CYTHON_FALLTHROUGH;
21258 7 : case 0: break;
21259 0 : default: goto __pyx_L5_argtuple_error;
21260 : }
21261 7 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
21262 7 : switch (__pyx_nargs) {
21263 0 : case 0:
21264 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
21265 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
21266 0 : kw_args--;
21267 : }
21268 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
21269 0 : else goto __pyx_L5_argtuple_error;
21270 0 : CYTHON_FALLTHROUGH;
21271 : case 1:
21272 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_peaks)) != 0)) {
21273 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
21274 0 : kw_args--;
21275 : }
21276 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
21277 : else {
21278 0 : __Pyx_RaiseArgtupleInvalid("_peak_prominences", 1, 3, 3, 1); __PYX_ERR(0, 166, __pyx_L3_error)
21279 : }
21280 7 : CYTHON_FALLTHROUGH;
21281 : case 2:
21282 7 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_wlen)) != 0)) {
21283 7 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
21284 7 : kw_args--;
21285 : }
21286 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L3_error)
21287 : else {
21288 0 : __Pyx_RaiseArgtupleInvalid("_peak_prominences", 1, 3, 3, 2); __PYX_ERR(0, 166, __pyx_L3_error)
21289 : }
21290 : }
21291 7 : if (unlikely(kw_args > 0)) {
21292 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
21293 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_peak_prominences") < 0)) __PYX_ERR(0, 166, __pyx_L3_error)
21294 : }
21295 40 : } else if (unlikely(__pyx_nargs != 3)) {
21296 0 : goto __pyx_L5_argtuple_error;
21297 : } else {
21298 40 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
21299 40 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
21300 40 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
21301 : }
21302 47 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 166, __pyx_L3_error)
21303 47 : __pyx_v_peaks = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t__const__(values[1], 0); if (unlikely(!__pyx_v_peaks.memview)) __PYX_ERR(0, 167, __pyx_L3_error)
21304 47 : __pyx_v_wlen = __Pyx_PyInt_As_npy_intp(values[2]); if (unlikely((__pyx_v_wlen == ((npy_intp)-1)) && PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L3_error)
21305 : }
21306 47 : goto __pyx_L6_skip;
21307 0 : __pyx_L5_argtuple_error:;
21308 0 : __Pyx_RaiseArgtupleInvalid("_peak_prominences", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 166, __pyx_L3_error)
21309 47 : __pyx_L6_skip:;
21310 47 : goto __pyx_L4_argument_unpacking_done;
21311 0 : __pyx_L3_error:;
21312 : {
21313 0 : Py_ssize_t __pyx_temp;
21314 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21315 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21316 : }
21317 : }
21318 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
21319 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_peaks, 1);
21320 0 : __Pyx_AddTraceback("scipy.signal._peak_finding_utils._peak_prominences", __pyx_clineno, __pyx_lineno, __pyx_filename);
21321 0 : __Pyx_RefNannyFinishContext();
21322 0 : return NULL;
21323 47 : __pyx_L4_argument_unpacking_done:;
21324 47 : if (unlikely(((PyObject *)__pyx_v_x.memview) == Py_None)) {
21325 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "x"); __PYX_ERR(0, 166, __pyx_L1_error)
21326 : }
21327 47 : if (unlikely(((PyObject *)__pyx_v_peaks.memview) == Py_None)) {
21328 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "peaks"); __PYX_ERR(0, 167, __pyx_L1_error)
21329 : }
21330 47 : __pyx_r = __pyx_pf_5scipy_6signal_19_peak_finding_utils_4_peak_prominences(__pyx_self, __pyx_v_x, __pyx_v_peaks, __pyx_v_wlen);
21331 :
21332 : /* function exit code */
21333 47 : goto __pyx_L0;
21334 : __pyx_L1_error:;
21335 : __pyx_r = NULL;
21336 47 : __pyx_L0:;
21337 47 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
21338 47 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_peaks, 1);
21339 : {
21340 47 : Py_ssize_t __pyx_temp;
21341 47 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
21342 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
21343 : }
21344 : }
21345 : __Pyx_RefNannyFinishContext();
21346 : return __pyx_r;
21347 : }
21348 :
21349 47 : static PyObject *__pyx_pf_5scipy_6signal_19_peak_finding_utils_4_peak_prominences(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_peaks, __pyx_t_5numpy_intp_t __pyx_v_wlen) {
21350 47 : __Pyx_memviewslice __pyx_v_prominences = { 0, 0, { 0 }, { 0 }, { 0 } };
21351 47 : __Pyx_memviewslice __pyx_v_left_bases = { 0, 0, { 0 }, { 0 }, { 0 } };
21352 47 : __Pyx_memviewslice __pyx_v_right_bases = { 0, 0, { 0 }, { 0 }, { 0 } };
21353 47 : __pyx_t_5numpy_float64_t __pyx_v_left_min;
21354 47 : __pyx_t_5numpy_float64_t __pyx_v_right_min;
21355 47 : __pyx_t_5numpy_intp_t __pyx_v_peak_nr;
21356 47 : __pyx_t_5numpy_intp_t __pyx_v_peak;
21357 47 : __pyx_t_5numpy_intp_t __pyx_v_i_min;
21358 47 : __pyx_t_5numpy_intp_t __pyx_v_i_max;
21359 47 : __pyx_t_5numpy_intp_t __pyx_v_i;
21360 47 : __pyx_t_5numpy_uint8_t __pyx_v_show_warning;
21361 47 : PyObject *__pyx_r = NULL;
21362 : __Pyx_RefNannyDeclarations
21363 47 : PyObject *__pyx_t_1 = NULL;
21364 47 : PyObject *__pyx_t_2 = NULL;
21365 47 : PyObject *__pyx_t_3 = NULL;
21366 47 : PyObject *__pyx_t_4 = NULL;
21367 47 : PyObject *__pyx_t_5 = NULL;
21368 47 : __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
21369 47 : __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
21370 47 : Py_ssize_t __pyx_t_8;
21371 47 : Py_ssize_t __pyx_t_9;
21372 47 : __pyx_t_5numpy_intp_t __pyx_t_10;
21373 47 : Py_ssize_t __pyx_t_11;
21374 47 : int __pyx_t_12;
21375 47 : int __pyx_t_13;
21376 47 : unsigned int __pyx_t_14;
21377 47 : __pyx_t_5numpy_intp_t __pyx_t_15;
21378 47 : __pyx_t_5numpy_intp_t __pyx_t_16;
21379 47 : __pyx_t_5numpy_intp_t __pyx_t_17;
21380 47 : Py_ssize_t __pyx_t_18;
21381 47 : __pyx_t_5numpy_float64_t __pyx_t_19;
21382 47 : __pyx_t_5numpy_float64_t __pyx_t_20;
21383 47 : __pyx_t_5numpy_float64_t __pyx_t_21;
21384 47 : int __pyx_lineno = 0;
21385 47 : const char *__pyx_filename = NULL;
21386 47 : int __pyx_clineno = 0;
21387 47 : __Pyx_RefNannySetupContext("_peak_prominences", 1);
21388 :
21389 : /* "scipy/signal/_peak_finding_utils.pyx":213
21390 : * np.uint8_t show_warning
21391 : *
21392 : * show_warning = False # <<<<<<<<<<<<<<
21393 : * prominences = np.empty(peaks.shape[0], dtype=np.float64)
21394 : * left_bases = np.empty(peaks.shape[0], dtype=np.intp)
21395 : */
21396 47 : __pyx_v_show_warning = 0;
21397 :
21398 : /* "scipy/signal/_peak_finding_utils.pyx":214
21399 : *
21400 : * show_warning = False
21401 : * prominences = np.empty(peaks.shape[0], dtype=np.float64) # <<<<<<<<<<<<<<
21402 : * left_bases = np.empty(peaks.shape[0], dtype=np.intp)
21403 : * right_bases = np.empty(peaks.shape[0], dtype=np.intp)
21404 : */
21405 47 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
21406 47 : __Pyx_GOTREF(__pyx_t_1);
21407 47 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
21408 47 : __Pyx_GOTREF(__pyx_t_2);
21409 47 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21410 47 : __pyx_t_1 = PyInt_FromSsize_t((__pyx_v_peaks.shape[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
21411 47 : __Pyx_GOTREF(__pyx_t_1);
21412 47 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
21413 47 : __Pyx_GOTREF(__pyx_t_3);
21414 47 : __Pyx_GIVEREF(__pyx_t_1);
21415 47 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error);
21416 47 : __pyx_t_1 = 0;
21417 47 : __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
21418 47 : __Pyx_GOTREF(__pyx_t_1);
21419 47 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
21420 47 : __Pyx_GOTREF(__pyx_t_4);
21421 47 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error)
21422 47 : __Pyx_GOTREF(__pyx_t_5);
21423 47 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21424 47 : if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
21425 47 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21426 47 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error)
21427 47 : __Pyx_GOTREF(__pyx_t_5);
21428 47 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21429 47 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21430 47 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21431 47 : __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 214, __pyx_L1_error)
21432 47 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21433 47 : __pyx_v_prominences = __pyx_t_6;
21434 47 : __pyx_t_6.memview = NULL;
21435 47 : __pyx_t_6.data = NULL;
21436 :
21437 : /* "scipy/signal/_peak_finding_utils.pyx":215
21438 : * show_warning = False
21439 : * prominences = np.empty(peaks.shape[0], dtype=np.float64)
21440 : * left_bases = np.empty(peaks.shape[0], dtype=np.intp) # <<<<<<<<<<<<<<
21441 : * right_bases = np.empty(peaks.shape[0], dtype=np.intp)
21442 : *
21443 : */
21444 47 : __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
21445 47 : __Pyx_GOTREF(__pyx_t_5);
21446 47 : __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 215, __pyx_L1_error)
21447 47 : __Pyx_GOTREF(__pyx_t_1);
21448 47 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21449 47 : __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_peaks.shape[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
21450 47 : __Pyx_GOTREF(__pyx_t_5);
21451 47 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
21452 47 : __Pyx_GOTREF(__pyx_t_3);
21453 47 : __Pyx_GIVEREF(__pyx_t_5);
21454 47 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error);
21455 47 : __pyx_t_5 = 0;
21456 47 : __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
21457 47 : __Pyx_GOTREF(__pyx_t_5);
21458 47 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 215, __pyx_L1_error)
21459 47 : __Pyx_GOTREF(__pyx_t_2);
21460 47 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_intp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
21461 47 : __Pyx_GOTREF(__pyx_t_4);
21462 47 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21463 47 : if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
21464 47 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21465 47 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 215, __pyx_L1_error)
21466 47 : __Pyx_GOTREF(__pyx_t_4);
21467 47 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21468 47 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21469 47 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21470 47 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 215, __pyx_L1_error)
21471 47 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21472 47 : __pyx_v_left_bases = __pyx_t_7;
21473 47 : __pyx_t_7.memview = NULL;
21474 47 : __pyx_t_7.data = NULL;
21475 :
21476 : /* "scipy/signal/_peak_finding_utils.pyx":216
21477 : * prominences = np.empty(peaks.shape[0], dtype=np.float64)
21478 : * left_bases = np.empty(peaks.shape[0], dtype=np.intp)
21479 : * right_bases = np.empty(peaks.shape[0], dtype=np.intp) # <<<<<<<<<<<<<<
21480 : *
21481 : * with nogil:
21482 : */
21483 47 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
21484 47 : __Pyx_GOTREF(__pyx_t_4);
21485 47 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
21486 47 : __Pyx_GOTREF(__pyx_t_5);
21487 47 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21488 47 : __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_peaks.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
21489 47 : __Pyx_GOTREF(__pyx_t_4);
21490 47 : __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
21491 47 : __Pyx_GOTREF(__pyx_t_3);
21492 47 : __Pyx_GIVEREF(__pyx_t_4);
21493 47 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error);
21494 47 : __pyx_t_4 = 0;
21495 47 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
21496 47 : __Pyx_GOTREF(__pyx_t_4);
21497 47 : __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
21498 47 : __Pyx_GOTREF(__pyx_t_1);
21499 47 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_intp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
21500 47 : __Pyx_GOTREF(__pyx_t_2);
21501 47 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21502 47 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
21503 47 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21504 47 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
21505 47 : __Pyx_GOTREF(__pyx_t_2);
21506 47 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21507 47 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21508 47 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21509 47 : __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 216, __pyx_L1_error)
21510 47 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21511 47 : __pyx_v_right_bases = __pyx_t_7;
21512 47 : __pyx_t_7.memview = NULL;
21513 47 : __pyx_t_7.data = NULL;
21514 :
21515 : /* "scipy/signal/_peak_finding_utils.pyx":218
21516 : * right_bases = np.empty(peaks.shape[0], dtype=np.intp)
21517 : *
21518 : * with nogil: # <<<<<<<<<<<<<<
21519 : * for peak_nr in range(peaks.shape[0]):
21520 : * peak = peaks[peak_nr]
21521 : */
21522 : {
21523 : #ifdef WITH_THREAD
21524 47 : PyThreadState *_save;
21525 47 : _save = NULL;
21526 47 : Py_UNBLOCK_THREADS
21527 47 : __Pyx_FastGIL_Remember();
21528 : #endif
21529 : /*try:*/ {
21530 :
21531 : /* "scipy/signal/_peak_finding_utils.pyx":219
21532 : *
21533 : * with nogil:
21534 : * for peak_nr in range(peaks.shape[0]): # <<<<<<<<<<<<<<
21535 : * peak = peaks[peak_nr]
21536 : * i_min = 0
21537 : */
21538 47 : __pyx_t_8 = (__pyx_v_peaks.shape[0]);
21539 47 : __pyx_t_9 = __pyx_t_8;
21540 188 : for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
21541 101 : __pyx_v_peak_nr = __pyx_t_10;
21542 :
21543 : /* "scipy/signal/_peak_finding_utils.pyx":220
21544 : * with nogil:
21545 : * for peak_nr in range(peaks.shape[0]):
21546 : * peak = peaks[peak_nr] # <<<<<<<<<<<<<<
21547 : * i_min = 0
21548 : * i_max = x.shape[0] - 1
21549 : */
21550 101 : __pyx_t_11 = __pyx_v_peak_nr;
21551 101 : __pyx_v_peak = (*((__pyx_t_5numpy_intp_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t const *) __pyx_v_peaks.data) + __pyx_t_11)) )));
21552 :
21553 : /* "scipy/signal/_peak_finding_utils.pyx":221
21554 : * for peak_nr in range(peaks.shape[0]):
21555 : * peak = peaks[peak_nr]
21556 : * i_min = 0 # <<<<<<<<<<<<<<
21557 : * i_max = x.shape[0] - 1
21558 : * if not i_min <= peak <= i_max:
21559 : */
21560 101 : __pyx_v_i_min = 0;
21561 :
21562 : /* "scipy/signal/_peak_finding_utils.pyx":222
21563 : * peak = peaks[peak_nr]
21564 : * i_min = 0
21565 : * i_max = x.shape[0] - 1 # <<<<<<<<<<<<<<
21566 : * if not i_min <= peak <= i_max:
21567 : * with gil:
21568 : */
21569 101 : __pyx_v_i_max = ((__pyx_v_x.shape[0]) - 1);
21570 :
21571 : /* "scipy/signal/_peak_finding_utils.pyx":223
21572 : * i_min = 0
21573 : * i_max = x.shape[0] - 1
21574 : * if not i_min <= peak <= i_max: # <<<<<<<<<<<<<<
21575 : * with gil:
21576 : * raise ValueError("peak {} is not a valid index for `x`"
21577 : */
21578 101 : __pyx_t_12 = (__pyx_v_i_min <= __pyx_v_peak);
21579 101 : if (__pyx_t_12) {
21580 99 : __pyx_t_12 = (__pyx_v_peak <= __pyx_v_i_max);
21581 : }
21582 101 : __pyx_t_13 = (!__pyx_t_12);
21583 101 : if (unlikely(__pyx_t_13)) {
21584 :
21585 : /* "scipy/signal/_peak_finding_utils.pyx":224
21586 : * i_max = x.shape[0] - 1
21587 : * if not i_min <= peak <= i_max:
21588 : * with gil: # <<<<<<<<<<<<<<
21589 : * raise ValueError("peak {} is not a valid index for `x`"
21590 : * .format(peak))
21591 : */
21592 : {
21593 : #ifdef WITH_THREAD
21594 7 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
21595 : #endif
21596 : /*try:*/ {
21597 :
21598 : /* "scipy/signal/_peak_finding_utils.pyx":226
21599 : * with gil:
21600 : * raise ValueError("peak {} is not a valid index for `x`"
21601 : * .format(peak)) # <<<<<<<<<<<<<<
21602 : *
21603 : * if 2 <= wlen:
21604 : */
21605 7 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_peak_is_not_a_valid_index_for_x, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L12_error)
21606 7 : __Pyx_GOTREF(__pyx_t_4);
21607 7 : __pyx_t_3 = __Pyx_PyInt_From_npy_intp(__pyx_v_peak); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L12_error)
21608 7 : __Pyx_GOTREF(__pyx_t_3);
21609 7 : __pyx_t_5 = NULL;
21610 7 : __pyx_t_14 = 0;
21611 : #if CYTHON_UNPACK_METHODS
21612 7 : if (likely(PyMethod_Check(__pyx_t_4))) {
21613 0 : __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
21614 0 : if (likely(__pyx_t_5)) {
21615 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
21616 0 : __Pyx_INCREF(__pyx_t_5);
21617 0 : __Pyx_INCREF(function);
21618 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
21619 : __pyx_t_14 = 1;
21620 : }
21621 : }
21622 : #endif
21623 : {
21624 7 : PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
21625 7 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
21626 7 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21627 7 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21628 7 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L12_error)
21629 7 : __Pyx_GOTREF(__pyx_t_2);
21630 7 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21631 : }
21632 :
21633 : /* "scipy/signal/_peak_finding_utils.pyx":225
21634 : * if not i_min <= peak <= i_max:
21635 : * with gil:
21636 : * raise ValueError("peak {} is not a valid index for `x`" # <<<<<<<<<<<<<<
21637 : * .format(peak))
21638 : *
21639 : */
21640 7 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L12_error)
21641 7 : __Pyx_GOTREF(__pyx_t_4);
21642 7 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21643 7 : __Pyx_Raise(__pyx_t_4, 0, 0, 0);
21644 7 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21645 7 : __PYX_ERR(0, 225, __pyx_L12_error)
21646 : }
21647 :
21648 : /* "scipy/signal/_peak_finding_utils.pyx":224
21649 : * i_max = x.shape[0] - 1
21650 : * if not i_min <= peak <= i_max:
21651 : * with gil: # <<<<<<<<<<<<<<
21652 : * raise ValueError("peak {} is not a valid index for `x`"
21653 : * .format(peak))
21654 : */
21655 : /*finally:*/ {
21656 7 : __pyx_L12_error: {
21657 : #ifdef WITH_THREAD
21658 7 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
21659 : #endif
21660 7 : goto __pyx_L4_error;
21661 : }
21662 : }
21663 : }
21664 :
21665 : /* "scipy/signal/_peak_finding_utils.pyx":223
21666 : * i_min = 0
21667 : * i_max = x.shape[0] - 1
21668 : * if not i_min <= peak <= i_max: # <<<<<<<<<<<<<<
21669 : * with gil:
21670 : * raise ValueError("peak {} is not a valid index for `x`"
21671 : */
21672 : }
21673 :
21674 : /* "scipy/signal/_peak_finding_utils.pyx":228
21675 : * .format(peak))
21676 : *
21677 : * if 2 <= wlen: # <<<<<<<<<<<<<<
21678 : * # Adjust window around the evaluated peak (within bounds);
21679 : * # if wlen is even the resulting window length is implicitly
21680 : */
21681 94 : __pyx_t_13 = (2 <= __pyx_v_wlen);
21682 94 : if (__pyx_t_13) {
21683 :
21684 : /* "scipy/signal/_peak_finding_utils.pyx":232
21685 : * # if wlen is even the resulting window length is implicitly
21686 : * # rounded to next odd integer
21687 : * i_min = max(peak - wlen // 2, i_min) # <<<<<<<<<<<<<<
21688 : * i_max = min(peak + wlen // 2, i_max)
21689 : *
21690 : */
21691 9 : __pyx_t_15 = __pyx_v_i_min;
21692 9 : __pyx_t_16 = (__pyx_v_peak - __Pyx_div___pyx_t_5numpy_intp_t(__pyx_v_wlen, 2));
21693 9 : __pyx_t_13 = (__pyx_t_15 > __pyx_t_16);
21694 9 : if (__pyx_t_13) {
21695 : __pyx_t_17 = __pyx_t_15;
21696 : } else {
21697 : __pyx_t_17 = __pyx_t_16;
21698 : }
21699 9 : __pyx_v_i_min = __pyx_t_17;
21700 :
21701 : /* "scipy/signal/_peak_finding_utils.pyx":233
21702 : * # rounded to next odd integer
21703 : * i_min = max(peak - wlen // 2, i_min)
21704 : * i_max = min(peak + wlen // 2, i_max) # <<<<<<<<<<<<<<
21705 : *
21706 : * # Find the left base in interval [i_min, peak]
21707 : */
21708 9 : __pyx_t_17 = __pyx_v_i_max;
21709 9 : __pyx_t_15 = (__pyx_v_peak + __Pyx_div___pyx_t_5numpy_intp_t(__pyx_v_wlen, 2));
21710 9 : __pyx_t_13 = (__pyx_t_17 < __pyx_t_15);
21711 9 : if (__pyx_t_13) {
21712 : __pyx_t_16 = __pyx_t_17;
21713 : } else {
21714 : __pyx_t_16 = __pyx_t_15;
21715 : }
21716 : __pyx_v_i_max = __pyx_t_16;
21717 :
21718 : /* "scipy/signal/_peak_finding_utils.pyx":228
21719 : * .format(peak))
21720 : *
21721 : * if 2 <= wlen: # <<<<<<<<<<<<<<
21722 : * # Adjust window around the evaluated peak (within bounds);
21723 : * # if wlen is even the resulting window length is implicitly
21724 : */
21725 : }
21726 :
21727 : /* "scipy/signal/_peak_finding_utils.pyx":236
21728 : *
21729 : * # Find the left base in interval [i_min, peak]
21730 : * i = left_bases[peak_nr] = peak # <<<<<<<<<<<<<<
21731 : * left_min = x[peak]
21732 : * while i_min <= i and x[i] <= x[peak]:
21733 : */
21734 94 : __pyx_v_i = __pyx_v_peak;
21735 94 : __pyx_t_11 = __pyx_v_peak_nr;
21736 94 : *((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_left_bases.data) + __pyx_t_11)) )) = __pyx_v_peak;
21737 :
21738 : /* "scipy/signal/_peak_finding_utils.pyx":237
21739 : * # Find the left base in interval [i_min, peak]
21740 : * i = left_bases[peak_nr] = peak
21741 : * left_min = x[peak] # <<<<<<<<<<<<<<
21742 : * while i_min <= i and x[i] <= x[peak]:
21743 : * if x[i] < left_min:
21744 : */
21745 94 : __pyx_t_11 = __pyx_v_peak;
21746 94 : __pyx_v_left_min = (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_11)) )));
21747 :
21748 : /* "scipy/signal/_peak_finding_utils.pyx":238
21749 : * i = left_bases[peak_nr] = peak
21750 : * left_min = x[peak]
21751 : * while i_min <= i and x[i] <= x[peak]: # <<<<<<<<<<<<<<
21752 : * if x[i] < left_min:
21753 : * left_min = x[i]
21754 : */
21755 5318 : while (1) {
21756 2706 : __pyx_t_12 = (__pyx_v_i_min <= __pyx_v_i);
21757 2706 : if (__pyx_t_12) {
21758 2615 : } else {
21759 91 : __pyx_t_13 = __pyx_t_12;
21760 91 : goto __pyx_L17_bool_binop_done;
21761 : }
21762 2615 : __pyx_t_11 = __pyx_v_i;
21763 2615 : __pyx_t_18 = __pyx_v_peak;
21764 2615 : __pyx_t_12 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_11)) ))) <= (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_18)) ))));
21765 2615 : __pyx_t_13 = __pyx_t_12;
21766 2706 : __pyx_L17_bool_binop_done:;
21767 2706 : if (!__pyx_t_13) break;
21768 :
21769 : /* "scipy/signal/_peak_finding_utils.pyx":239
21770 : * left_min = x[peak]
21771 : * while i_min <= i and x[i] <= x[peak]:
21772 : * if x[i] < left_min: # <<<<<<<<<<<<<<
21773 : * left_min = x[i]
21774 : * left_bases[peak_nr] = i
21775 : */
21776 2612 : __pyx_t_18 = __pyx_v_i;
21777 2612 : __pyx_t_13 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_18)) ))) < __pyx_v_left_min);
21778 2612 : if (__pyx_t_13) {
21779 :
21780 : /* "scipy/signal/_peak_finding_utils.pyx":240
21781 : * while i_min <= i and x[i] <= x[peak]:
21782 : * if x[i] < left_min:
21783 : * left_min = x[i] # <<<<<<<<<<<<<<
21784 : * left_bases[peak_nr] = i
21785 : * i -= 1
21786 : */
21787 1296 : __pyx_t_18 = __pyx_v_i;
21788 1296 : __pyx_v_left_min = (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_18)) )));
21789 :
21790 : /* "scipy/signal/_peak_finding_utils.pyx":241
21791 : * if x[i] < left_min:
21792 : * left_min = x[i]
21793 : * left_bases[peak_nr] = i # <<<<<<<<<<<<<<
21794 : * i -= 1
21795 : *
21796 : */
21797 1296 : __pyx_t_18 = __pyx_v_peak_nr;
21798 1296 : *((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_left_bases.data) + __pyx_t_18)) )) = __pyx_v_i;
21799 :
21800 : /* "scipy/signal/_peak_finding_utils.pyx":239
21801 : * left_min = x[peak]
21802 : * while i_min <= i and x[i] <= x[peak]:
21803 : * if x[i] < left_min: # <<<<<<<<<<<<<<
21804 : * left_min = x[i]
21805 : * left_bases[peak_nr] = i
21806 : */
21807 : }
21808 :
21809 : /* "scipy/signal/_peak_finding_utils.pyx":242
21810 : * left_min = x[i]
21811 : * left_bases[peak_nr] = i
21812 : * i -= 1 # <<<<<<<<<<<<<<
21813 : *
21814 : * # Find the right base in interval [peak, i_max]
21815 : */
21816 2612 : __pyx_v_i = (__pyx_v_i - 1);
21817 : }
21818 :
21819 : /* "scipy/signal/_peak_finding_utils.pyx":245
21820 : *
21821 : * # Find the right base in interval [peak, i_max]
21822 : * i = right_bases[peak_nr] = peak # <<<<<<<<<<<<<<
21823 : * right_min = x[peak]
21824 : * while i <= i_max and x[i] <= x[peak]:
21825 : */
21826 94 : __pyx_v_i = __pyx_v_peak;
21827 94 : __pyx_t_18 = __pyx_v_peak_nr;
21828 94 : *((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_right_bases.data) + __pyx_t_18)) )) = __pyx_v_peak;
21829 :
21830 : /* "scipy/signal/_peak_finding_utils.pyx":246
21831 : * # Find the right base in interval [peak, i_max]
21832 : * i = right_bases[peak_nr] = peak
21833 : * right_min = x[peak] # <<<<<<<<<<<<<<
21834 : * while i <= i_max and x[i] <= x[peak]:
21835 : * if x[i] < right_min:
21836 : */
21837 94 : __pyx_t_18 = __pyx_v_peak;
21838 94 : __pyx_v_right_min = (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_18)) )));
21839 :
21840 : /* "scipy/signal/_peak_finding_utils.pyx":247
21841 : * i = right_bases[peak_nr] = peak
21842 : * right_min = x[peak]
21843 : * while i <= i_max and x[i] <= x[peak]: # <<<<<<<<<<<<<<
21844 : * if x[i] < right_min:
21845 : * right_min = x[i]
21846 : */
21847 580 : while (1) {
21848 337 : __pyx_t_12 = (__pyx_v_i <= __pyx_v_i_max);
21849 337 : if (__pyx_t_12) {
21850 300 : } else {
21851 37 : __pyx_t_13 = __pyx_t_12;
21852 37 : goto __pyx_L22_bool_binop_done;
21853 : }
21854 300 : __pyx_t_18 = __pyx_v_i;
21855 300 : __pyx_t_11 = __pyx_v_peak;
21856 300 : __pyx_t_12 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_18)) ))) <= (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_11)) ))));
21857 300 : __pyx_t_13 = __pyx_t_12;
21858 337 : __pyx_L22_bool_binop_done:;
21859 337 : if (!__pyx_t_13) break;
21860 :
21861 : /* "scipy/signal/_peak_finding_utils.pyx":248
21862 : * right_min = x[peak]
21863 : * while i <= i_max and x[i] <= x[peak]:
21864 : * if x[i] < right_min: # <<<<<<<<<<<<<<
21865 : * right_min = x[i]
21866 : * right_bases[peak_nr] = i
21867 : */
21868 243 : __pyx_t_11 = __pyx_v_i;
21869 243 : __pyx_t_13 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_11)) ))) < __pyx_v_right_min);
21870 243 : if (__pyx_t_13) {
21871 :
21872 : /* "scipy/signal/_peak_finding_utils.pyx":249
21873 : * while i <= i_max and x[i] <= x[peak]:
21874 : * if x[i] < right_min:
21875 : * right_min = x[i] # <<<<<<<<<<<<<<
21876 : * right_bases[peak_nr] = i
21877 : * i += 1
21878 : */
21879 120 : __pyx_t_11 = __pyx_v_i;
21880 120 : __pyx_v_right_min = (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_11)) )));
21881 :
21882 : /* "scipy/signal/_peak_finding_utils.pyx":250
21883 : * if x[i] < right_min:
21884 : * right_min = x[i]
21885 : * right_bases[peak_nr] = i # <<<<<<<<<<<<<<
21886 : * i += 1
21887 : *
21888 : */
21889 120 : __pyx_t_11 = __pyx_v_peak_nr;
21890 120 : *((__pyx_t_5numpy_intp_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t *) __pyx_v_right_bases.data) + __pyx_t_11)) )) = __pyx_v_i;
21891 :
21892 : /* "scipy/signal/_peak_finding_utils.pyx":248
21893 : * right_min = x[peak]
21894 : * while i <= i_max and x[i] <= x[peak]:
21895 : * if x[i] < right_min: # <<<<<<<<<<<<<<
21896 : * right_min = x[i]
21897 : * right_bases[peak_nr] = i
21898 : */
21899 : }
21900 :
21901 : /* "scipy/signal/_peak_finding_utils.pyx":251
21902 : * right_min = x[i]
21903 : * right_bases[peak_nr] = i
21904 : * i += 1 # <<<<<<<<<<<<<<
21905 : *
21906 : * prominences[peak_nr] = x[peak] - max(left_min, right_min)
21907 : */
21908 243 : __pyx_v_i = (__pyx_v_i + 1);
21909 : }
21910 :
21911 : /* "scipy/signal/_peak_finding_utils.pyx":253
21912 : * i += 1
21913 : *
21914 : * prominences[peak_nr] = x[peak] - max(left_min, right_min) # <<<<<<<<<<<<<<
21915 : * if prominences[peak_nr] == 0:
21916 : * show_warning = True
21917 : */
21918 94 : __pyx_t_11 = __pyx_v_peak;
21919 94 : __pyx_t_19 = __pyx_v_right_min;
21920 94 : __pyx_t_20 = __pyx_v_left_min;
21921 94 : __pyx_t_13 = (__pyx_t_19 > __pyx_t_20);
21922 94 : if (__pyx_t_13) {
21923 : __pyx_t_21 = __pyx_t_19;
21924 : } else {
21925 34 : __pyx_t_21 = __pyx_t_20;
21926 : }
21927 94 : __pyx_t_18 = __pyx_v_peak_nr;
21928 94 : *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_prominences.data) + __pyx_t_18)) )) = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_11)) ))) - __pyx_t_21);
21929 :
21930 : /* "scipy/signal/_peak_finding_utils.pyx":254
21931 : *
21932 : * prominences[peak_nr] = x[peak] - max(left_min, right_min)
21933 : * if prominences[peak_nr] == 0: # <<<<<<<<<<<<<<
21934 : * show_warning = True
21935 : *
21936 : */
21937 94 : __pyx_t_11 = __pyx_v_peak_nr;
21938 94 : __pyx_t_13 = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_prominences.data) + __pyx_t_11)) ))) == 0.0);
21939 94 : if (__pyx_t_13) {
21940 :
21941 : /* "scipy/signal/_peak_finding_utils.pyx":255
21942 : * prominences[peak_nr] = x[peak] - max(left_min, right_min)
21943 : * if prominences[peak_nr] == 0:
21944 : * show_warning = True # <<<<<<<<<<<<<<
21945 : *
21946 : * if show_warning:
21947 : */
21948 6 : __pyx_v_show_warning = 1;
21949 :
21950 : /* "scipy/signal/_peak_finding_utils.pyx":254
21951 : *
21952 : * prominences[peak_nr] = x[peak] - max(left_min, right_min)
21953 : * if prominences[peak_nr] == 0: # <<<<<<<<<<<<<<
21954 : * show_warning = True
21955 : *
21956 : */
21957 : }
21958 : }
21959 : }
21960 :
21961 : /* "scipy/signal/_peak_finding_utils.pyx":218
21962 : * right_bases = np.empty(peaks.shape[0], dtype=np.intp)
21963 : *
21964 : * with nogil: # <<<<<<<<<<<<<<
21965 : * for peak_nr in range(peaks.shape[0]):
21966 : * peak = peaks[peak_nr]
21967 : */
21968 : /*finally:*/ {
21969 : /*normal exit:*/{
21970 : #ifdef WITH_THREAD
21971 40 : __Pyx_FastGIL_Forget();
21972 40 : Py_BLOCK_THREADS
21973 : #endif
21974 40 : goto __pyx_L5;
21975 : }
21976 7 : __pyx_L4_error: {
21977 : #ifdef WITH_THREAD
21978 7 : __Pyx_FastGIL_Forget();
21979 7 : Py_BLOCK_THREADS
21980 : #endif
21981 7 : goto __pyx_L1_error;
21982 : }
21983 40 : __pyx_L5:;
21984 : }
21985 : }
21986 :
21987 : /* "scipy/signal/_peak_finding_utils.pyx":257
21988 : * show_warning = True
21989 : *
21990 : * if show_warning: # <<<<<<<<<<<<<<
21991 : * warnings.warn("some peaks have a prominence of 0",
21992 : * PeakPropertyWarning, stacklevel=2)
21993 : */
21994 40 : __pyx_t_13 = (__pyx_v_show_warning != 0);
21995 40 : if (__pyx_t_13) {
21996 :
21997 : /* "scipy/signal/_peak_finding_utils.pyx":258
21998 : *
21999 : * if show_warning:
22000 : * warnings.warn("some peaks have a prominence of 0", # <<<<<<<<<<<<<<
22001 : * PeakPropertyWarning, stacklevel=2)
22002 : * # Return memoryviews as ndarrays
22003 : */
22004 5 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error)
22005 5 : __Pyx_GOTREF(__pyx_t_4);
22006 5 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error)
22007 5 : __Pyx_GOTREF(__pyx_t_2);
22008 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22009 :
22010 : /* "scipy/signal/_peak_finding_utils.pyx":259
22011 : * if show_warning:
22012 : * warnings.warn("some peaks have a prominence of 0",
22013 : * PeakPropertyWarning, stacklevel=2) # <<<<<<<<<<<<<<
22014 : * # Return memoryviews as ndarrays
22015 : * return prominences.base, left_bases.base, right_bases.base
22016 : */
22017 5 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PeakPropertyWarning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
22018 5 : __Pyx_GOTREF(__pyx_t_4);
22019 :
22020 : /* "scipy/signal/_peak_finding_utils.pyx":258
22021 : *
22022 : * if show_warning:
22023 : * warnings.warn("some peaks have a prominence of 0", # <<<<<<<<<<<<<<
22024 : * PeakPropertyWarning, stacklevel=2)
22025 : * # Return memoryviews as ndarrays
22026 : */
22027 5 : __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error)
22028 5 : __Pyx_GOTREF(__pyx_t_3);
22029 5 : __Pyx_INCREF(__pyx_kp_u_some_peaks_have_a_prominence_of);
22030 5 : __Pyx_GIVEREF(__pyx_kp_u_some_peaks_have_a_prominence_of);
22031 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u_some_peaks_have_a_prominence_of)) __PYX_ERR(0, 258, __pyx_L1_error);
22032 5 : __Pyx_GIVEREF(__pyx_t_4);
22033 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 258, __pyx_L1_error);
22034 5 : __pyx_t_4 = 0;
22035 :
22036 : /* "scipy/signal/_peak_finding_utils.pyx":259
22037 : * if show_warning:
22038 : * warnings.warn("some peaks have a prominence of 0",
22039 : * PeakPropertyWarning, stacklevel=2) # <<<<<<<<<<<<<<
22040 : * # Return memoryviews as ndarrays
22041 : * return prominences.base, left_bases.base, right_bases.base
22042 : */
22043 5 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 259, __pyx_L1_error)
22044 5 : __Pyx_GOTREF(__pyx_t_4);
22045 5 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(0, 259, __pyx_L1_error)
22046 :
22047 : /* "scipy/signal/_peak_finding_utils.pyx":258
22048 : *
22049 : * if show_warning:
22050 : * warnings.warn("some peaks have a prominence of 0", # <<<<<<<<<<<<<<
22051 : * PeakPropertyWarning, stacklevel=2)
22052 : * # Return memoryviews as ndarrays
22053 : */
22054 5 : __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
22055 5 : __Pyx_GOTREF(__pyx_t_5);
22056 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22057 5 : __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22058 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22059 5 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22060 :
22061 : /* "scipy/signal/_peak_finding_utils.pyx":257
22062 : * show_warning = True
22063 : *
22064 : * if show_warning: # <<<<<<<<<<<<<<
22065 : * warnings.warn("some peaks have a prominence of 0",
22066 : * PeakPropertyWarning, stacklevel=2)
22067 : */
22068 : }
22069 :
22070 : /* "scipy/signal/_peak_finding_utils.pyx":261
22071 : * PeakPropertyWarning, stacklevel=2)
22072 : * # Return memoryviews as ndarrays
22073 : * return prominences.base, left_bases.base, right_bases.base # <<<<<<<<<<<<<<
22074 : *
22075 : *
22076 : */
22077 40 : __Pyx_XDECREF(__pyx_r);
22078 40 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_prominences, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
22079 40 : __Pyx_GOTREF(__pyx_t_5);
22080 40 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
22081 40 : __Pyx_GOTREF(__pyx_t_4);
22082 40 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22083 40 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_left_bases, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
22084 40 : __Pyx_GOTREF(__pyx_t_5);
22085 40 : __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error)
22086 40 : __Pyx_GOTREF(__pyx_t_3);
22087 40 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22088 40 : __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_right_bases, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_intp_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_intp_t, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
22089 40 : __Pyx_GOTREF(__pyx_t_5);
22090 40 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
22091 40 : __Pyx_GOTREF(__pyx_t_2);
22092 40 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22093 40 : __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
22094 40 : __Pyx_GOTREF(__pyx_t_5);
22095 40 : __Pyx_GIVEREF(__pyx_t_4);
22096 40 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error);
22097 40 : __Pyx_GIVEREF(__pyx_t_3);
22098 40 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error);
22099 40 : __Pyx_GIVEREF(__pyx_t_2);
22100 40 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error);
22101 40 : __pyx_t_4 = 0;
22102 40 : __pyx_t_3 = 0;
22103 40 : __pyx_t_2 = 0;
22104 40 : __pyx_r = __pyx_t_5;
22105 40 : __pyx_t_5 = 0;
22106 40 : goto __pyx_L0;
22107 :
22108 : /* "scipy/signal/_peak_finding_utils.pyx":166
22109 : *
22110 : *
22111 : * def _peak_prominences(const np.float64_t[::1] x not None, # <<<<<<<<<<<<<<
22112 : * const np.intp_t[::1] peaks not None,
22113 : * np.intp_t wlen):
22114 : */
22115 :
22116 : /* function exit code */
22117 7 : __pyx_L1_error:;
22118 7 : __Pyx_XDECREF(__pyx_t_1);
22119 7 : __Pyx_XDECREF(__pyx_t_2);
22120 7 : __Pyx_XDECREF(__pyx_t_3);
22121 7 : __Pyx_XDECREF(__pyx_t_4);
22122 7 : __Pyx_XDECREF(__pyx_t_5);
22123 7 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
22124 7 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_7, 1);
22125 7 : __Pyx_AddTraceback("scipy.signal._peak_finding_utils._peak_prominences", __pyx_clineno, __pyx_lineno, __pyx_filename);
22126 7 : __pyx_r = NULL;
22127 47 : __pyx_L0:;
22128 47 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_prominences, 1);
22129 47 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_left_bases, 1);
22130 47 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_right_bases, 1);
22131 47 : __Pyx_XGIVEREF(__pyx_r);
22132 47 : __Pyx_RefNannyFinishContext();
22133 47 : return __pyx_r;
22134 : }
22135 :
22136 : /* "scipy/signal/_peak_finding_utils.pyx":264
22137 : *
22138 : *
22139 : * def _peak_widths(const np.float64_t[::1] x not None, # <<<<<<<<<<<<<<
22140 : * const np.intp_t[::1] peaks not None,
22141 : * np.float64_t rel_height,
22142 : */
22143 :
22144 : /* Python wrapper */
22145 : static PyObject *__pyx_pw_5scipy_6signal_19_peak_finding_utils_7_peak_widths(PyObject *__pyx_self,
22146 : #if CYTHON_METH_FASTCALL
22147 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22148 : #else
22149 : PyObject *__pyx_args, PyObject *__pyx_kwds
22150 : #endif
22151 : ); /*proto*/
22152 : PyDoc_STRVAR(__pyx_doc_5scipy_6signal_19_peak_finding_utils_6_peak_widths, "\n Calculate the width of each each peak in a signal.\n\n Parameters\n ----------\n x : ndarray\n A signal with peaks.\n peaks : ndarray\n Indices of peaks in `x`.\n rel_height : np.float64\n Chooses the relative height at which the peak width is measured as a\n percentage of its prominence (see `peak_widths`).\n prominences : ndarray\n Prominences of each peak in `peaks` as returned by `peak_prominences`.\n left_bases, right_bases : ndarray\n Left and right bases of each peak in `peaks` as returned by\n `peak_prominences`.\n\n Returns\n -------\n widths : ndarray\n The widths for each peak in samples.\n width_heights : ndarray\n The height of the contour lines at which the `widths` where evaluated.\n left_ips, right_ips : ndarray\n Interpolated positions of left and right intersection points of a\n horizontal line at the respective evaluation height.\n\n Raises\n ------\n ValueError\n If the supplied prominence data doesn't satisfy the condition\n ``0 <= left_base <= peak <= right_base < x.shape[0]`` for each peak or\n if `peaks`, `left_bases` and `right_bases` don't share the same shape.\n Or if `rel_height` is not at least 0.\n\n Warnings\n --------\n PeakPropertyWarning\n If a width of 0 was calculated for any peak.\n\n Notes\n -----\n This is the inner function to `peak_widths`.\n\n .. versionadded:: 1.1.0\n ");
22153 : static PyMethodDef __pyx_mdef_5scipy_6signal_19_peak_finding_utils_7_peak_widths = {"_peak_widths", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5scipy_6signal_19_peak_finding_utils_7_peak_widths, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5scipy_6signal_19_peak_finding_utils_6_peak_widths};
22154 29 : static PyObject *__pyx_pw_5scipy_6signal_19_peak_finding_utils_7_peak_widths(PyObject *__pyx_self,
22155 : #if CYTHON_METH_FASTCALL
22156 : PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
22157 : #else
22158 : PyObject *__pyx_args, PyObject *__pyx_kwds
22159 : #endif
22160 : ) {
22161 29 : __Pyx_memviewslice __pyx_v_x = { 0, 0, { 0 }, { 0 }, { 0 } };
22162 29 : __Pyx_memviewslice __pyx_v_peaks = { 0, 0, { 0 }, { 0 }, { 0 } };
22163 29 : __pyx_t_5numpy_float64_t __pyx_v_rel_height;
22164 29 : __Pyx_memviewslice __pyx_v_prominences = { 0, 0, { 0 }, { 0 }, { 0 } };
22165 29 : __Pyx_memviewslice __pyx_v_left_bases = { 0, 0, { 0 }, { 0 }, { 0 } };
22166 29 : __Pyx_memviewslice __pyx_v_right_bases = { 0, 0, { 0 }, { 0 }, { 0 } };
22167 : #if !CYTHON_METH_FASTCALL
22168 : CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22169 : #endif
22170 29 : CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22171 29 : PyObject* values[6] = {0,0,0,0,0,0};
22172 29 : int __pyx_lineno = 0;
22173 29 : const char *__pyx_filename = NULL;
22174 29 : int __pyx_clineno = 0;
22175 29 : PyObject *__pyx_r = 0;
22176 : __Pyx_RefNannyDeclarations
22177 29 : __Pyx_RefNannySetupContext("_peak_widths (wrapper)", 0);
22178 : #if !CYTHON_METH_FASTCALL
22179 : #if CYTHON_ASSUME_SAFE_MACROS
22180 : __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
22181 : #else
22182 : __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
22183 : #endif
22184 : #endif
22185 29 : __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
22186 : {
22187 29 : PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_peaks,&__pyx_n_s_rel_height,&__pyx_n_s_prominences,&__pyx_n_s_left_bases,&__pyx_n_s_right_bases,0};
22188 29 : if (__pyx_kwds) {
22189 0 : Py_ssize_t kw_args;
22190 0 : switch (__pyx_nargs) {
22191 0 : case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
22192 0 : CYTHON_FALLTHROUGH;
22193 0 : case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
22194 0 : CYTHON_FALLTHROUGH;
22195 0 : case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
22196 0 : CYTHON_FALLTHROUGH;
22197 0 : case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
22198 0 : CYTHON_FALLTHROUGH;
22199 0 : case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
22200 0 : CYTHON_FALLTHROUGH;
22201 0 : case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22202 0 : CYTHON_FALLTHROUGH;
22203 0 : case 0: break;
22204 0 : default: goto __pyx_L5_argtuple_error;
22205 : }
22206 0 : kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
22207 0 : switch (__pyx_nargs) {
22208 0 : case 0:
22209 0 : if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) {
22210 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
22211 0 : kw_args--;
22212 : }
22213 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L3_error)
22214 0 : else goto __pyx_L5_argtuple_error;
22215 0 : CYTHON_FALLTHROUGH;
22216 : case 1:
22217 0 : if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_peaks)) != 0)) {
22218 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
22219 0 : kw_args--;
22220 : }
22221 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L3_error)
22222 : else {
22223 0 : __Pyx_RaiseArgtupleInvalid("_peak_widths", 1, 6, 6, 1); __PYX_ERR(0, 264, __pyx_L3_error)
22224 : }
22225 0 : CYTHON_FALLTHROUGH;
22226 : case 2:
22227 0 : if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_rel_height)) != 0)) {
22228 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
22229 0 : kw_args--;
22230 : }
22231 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L3_error)
22232 : else {
22233 0 : __Pyx_RaiseArgtupleInvalid("_peak_widths", 1, 6, 6, 2); __PYX_ERR(0, 264, __pyx_L3_error)
22234 : }
22235 0 : CYTHON_FALLTHROUGH;
22236 : case 3:
22237 0 : if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_prominences)) != 0)) {
22238 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
22239 0 : kw_args--;
22240 : }
22241 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L3_error)
22242 : else {
22243 0 : __Pyx_RaiseArgtupleInvalid("_peak_widths", 1, 6, 6, 3); __PYX_ERR(0, 264, __pyx_L3_error)
22244 : }
22245 0 : CYTHON_FALLTHROUGH;
22246 : case 4:
22247 0 : if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_left_bases)) != 0)) {
22248 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[4]);
22249 0 : kw_args--;
22250 : }
22251 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L3_error)
22252 : else {
22253 0 : __Pyx_RaiseArgtupleInvalid("_peak_widths", 1, 6, 6, 4); __PYX_ERR(0, 264, __pyx_L3_error)
22254 : }
22255 0 : CYTHON_FALLTHROUGH;
22256 : case 5:
22257 0 : if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_right_bases)) != 0)) {
22258 0 : (void)__Pyx_Arg_NewRef_FASTCALL(values[5]);
22259 0 : kw_args--;
22260 : }
22261 0 : else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L3_error)
22262 : else {
22263 0 : __Pyx_RaiseArgtupleInvalid("_peak_widths", 1, 6, 6, 5); __PYX_ERR(0, 264, __pyx_L3_error)
22264 : }
22265 : }
22266 0 : if (unlikely(kw_args > 0)) {
22267 0 : const Py_ssize_t kwd_pos_args = __pyx_nargs;
22268 0 : if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_peak_widths") < 0)) __PYX_ERR(0, 264, __pyx_L3_error)
22269 : }
22270 29 : } else if (unlikely(__pyx_nargs != 6)) {
22271 0 : goto __pyx_L5_argtuple_error;
22272 : } else {
22273 29 : values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
22274 29 : values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
22275 29 : values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
22276 29 : values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
22277 29 : values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
22278 29 : values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
22279 : }
22280 29 : __pyx_v_x = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t__const__(values[0], 0); if (unlikely(!__pyx_v_x.memview)) __PYX_ERR(0, 264, __pyx_L3_error)
22281 29 : __pyx_v_peaks = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t__const__(values[1], 0); if (unlikely(!__pyx_v_peaks.memview)) __PYX_ERR(0, 265, __pyx_L3_error)
22282 29 : __pyx_v_rel_height = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_rel_height == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error)
22283 29 : __pyx_v_prominences = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t__const__(values[3], 0); if (unlikely(!__pyx_v_prominences.memview)) __PYX_ERR(0, 267, __pyx_L3_error)
22284 29 : __pyx_v_left_bases = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t__const__(values[4], 0); if (unlikely(!__pyx_v_left_bases.memview)) __PYX_ERR(0, 268, __pyx_L3_error)
22285 29 : __pyx_v_right_bases = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t__const__(values[5], 0); if (unlikely(!__pyx_v_right_bases.memview)) __PYX_ERR(0, 269, __pyx_L3_error)
22286 : }
22287 29 : goto __pyx_L6_skip;
22288 0 : __pyx_L5_argtuple_error:;
22289 0 : __Pyx_RaiseArgtupleInvalid("_peak_widths", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 264, __pyx_L3_error)
22290 29 : __pyx_L6_skip:;
22291 29 : goto __pyx_L4_argument_unpacking_done;
22292 0 : __pyx_L3_error:;
22293 : {
22294 0 : Py_ssize_t __pyx_temp;
22295 0 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22296 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22297 : }
22298 : }
22299 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
22300 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_peaks, 1);
22301 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_prominences, 1);
22302 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_left_bases, 1);
22303 0 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_right_bases, 1);
22304 0 : __Pyx_AddTraceback("scipy.signal._peak_finding_utils._peak_widths", __pyx_clineno, __pyx_lineno, __pyx_filename);
22305 0 : __Pyx_RefNannyFinishContext();
22306 0 : return NULL;
22307 29 : __pyx_L4_argument_unpacking_done:;
22308 29 : if (unlikely(((PyObject *)__pyx_v_x.memview) == Py_None)) {
22309 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "x"); __PYX_ERR(0, 264, __pyx_L1_error)
22310 : }
22311 29 : if (unlikely(((PyObject *)__pyx_v_peaks.memview) == Py_None)) {
22312 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "peaks"); __PYX_ERR(0, 265, __pyx_L1_error)
22313 : }
22314 29 : if (unlikely(((PyObject *)__pyx_v_prominences.memview) == Py_None)) {
22315 1 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "prominences"); __PYX_ERR(0, 267, __pyx_L1_error)
22316 : }
22317 28 : if (unlikely(((PyObject *)__pyx_v_left_bases.memview) == Py_None)) {
22318 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "left_bases"); __PYX_ERR(0, 268, __pyx_L1_error)
22319 : }
22320 28 : if (unlikely(((PyObject *)__pyx_v_right_bases.memview) == Py_None)) {
22321 0 : PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "right_bases"); __PYX_ERR(0, 269, __pyx_L1_error)
22322 : }
22323 28 : __pyx_r = __pyx_pf_5scipy_6signal_19_peak_finding_utils_6_peak_widths(__pyx_self, __pyx_v_x, __pyx_v_peaks, __pyx_v_rel_height, __pyx_v_prominences, __pyx_v_left_bases, __pyx_v_right_bases);
22324 :
22325 : /* function exit code */
22326 28 : goto __pyx_L0;
22327 : __pyx_L1_error:;
22328 : __pyx_r = NULL;
22329 29 : __pyx_L0:;
22330 29 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_x, 1);
22331 29 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_peaks, 1);
22332 29 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_prominences, 1);
22333 29 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_left_bases, 1);
22334 29 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_right_bases, 1);
22335 : {
22336 29 : Py_ssize_t __pyx_temp;
22337 29 : for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
22338 : __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
22339 : }
22340 : }
22341 : __Pyx_RefNannyFinishContext();
22342 : return __pyx_r;
22343 : }
22344 :
22345 28 : static PyObject *__pyx_pf_5scipy_6signal_19_peak_finding_utils_6_peak_widths(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_peaks, __pyx_t_5numpy_float64_t __pyx_v_rel_height, __Pyx_memviewslice __pyx_v_prominences, __Pyx_memviewslice __pyx_v_left_bases, __Pyx_memviewslice __pyx_v_right_bases) {
22346 28 : __Pyx_memviewslice __pyx_v_widths = { 0, 0, { 0 }, { 0 }, { 0 } };
22347 28 : __Pyx_memviewslice __pyx_v_width_heights = { 0, 0, { 0 }, { 0 }, { 0 } };
22348 28 : __Pyx_memviewslice __pyx_v_left_ips = { 0, 0, { 0 }, { 0 }, { 0 } };
22349 28 : __Pyx_memviewslice __pyx_v_right_ips = { 0, 0, { 0 }, { 0 }, { 0 } };
22350 28 : __pyx_t_5numpy_float64_t __pyx_v_height;
22351 28 : __pyx_t_5numpy_float64_t __pyx_v_left_ip;
22352 28 : __pyx_t_5numpy_float64_t __pyx_v_right_ip;
22353 28 : __pyx_t_5numpy_intp_t __pyx_v_p;
22354 28 : __pyx_t_5numpy_intp_t __pyx_v_peak;
22355 28 : __pyx_t_5numpy_intp_t __pyx_v_i;
22356 28 : __pyx_t_5numpy_intp_t __pyx_v_i_max;
22357 28 : __pyx_t_5numpy_intp_t __pyx_v_i_min;
22358 28 : __pyx_t_5numpy_uint8_t __pyx_v_show_warning;
22359 28 : PyObject *__pyx_r = NULL;
22360 : __Pyx_RefNannyDeclarations
22361 28 : int __pyx_t_1;
22362 28 : PyObject *__pyx_t_2 = NULL;
22363 28 : int __pyx_t_3;
22364 28 : PyObject *__pyx_t_4 = NULL;
22365 28 : PyObject *__pyx_t_5 = NULL;
22366 28 : PyObject *__pyx_t_6 = NULL;
22367 28 : PyObject *__pyx_t_7 = NULL;
22368 28 : __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
22369 28 : Py_ssize_t __pyx_t_9;
22370 28 : Py_ssize_t __pyx_t_10;
22371 28 : __pyx_t_5numpy_intp_t __pyx_t_11;
22372 28 : Py_ssize_t __pyx_t_12;
22373 28 : unsigned int __pyx_t_13;
22374 28 : Py_ssize_t __pyx_t_14;
22375 28 : __pyx_t_5numpy_float64_t __pyx_t_15;
22376 28 : __pyx_t_5numpy_float64_t __pyx_t_16;
22377 28 : int __pyx_lineno = 0;
22378 28 : const char *__pyx_filename = NULL;
22379 28 : int __pyx_clineno = 0;
22380 28 : __Pyx_RefNannySetupContext("_peak_widths", 1);
22381 :
22382 : /* "scipy/signal/_peak_finding_utils.pyx":323
22383 : * np.uint8_t show_warning
22384 : *
22385 : * if rel_height < 0: # <<<<<<<<<<<<<<
22386 : * raise ValueError('`rel_height` must be greater or equal to 0.0')
22387 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0]
22388 : */
22389 28 : __pyx_t_1 = (__pyx_v_rel_height < 0.0);
22390 28 : if (unlikely(__pyx_t_1)) {
22391 :
22392 : /* "scipy/signal/_peak_finding_utils.pyx":324
22393 : *
22394 : * if rel_height < 0:
22395 : * raise ValueError('`rel_height` must be greater or equal to 0.0') # <<<<<<<<<<<<<<
22396 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0]
22397 : * == right_bases.shape[0]):
22398 : */
22399 1 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
22400 1 : __Pyx_GOTREF(__pyx_t_2);
22401 1 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
22402 1 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22403 1 : __PYX_ERR(0, 324, __pyx_L1_error)
22404 :
22405 : /* "scipy/signal/_peak_finding_utils.pyx":323
22406 : * np.uint8_t show_warning
22407 : *
22408 : * if rel_height < 0: # <<<<<<<<<<<<<<
22409 : * raise ValueError('`rel_height` must be greater or equal to 0.0')
22410 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0]
22411 : */
22412 : }
22413 :
22414 : /* "scipy/signal/_peak_finding_utils.pyx":325
22415 : * if rel_height < 0:
22416 : * raise ValueError('`rel_height` must be greater or equal to 0.0')
22417 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0] # <<<<<<<<<<<<<<
22418 : * == right_bases.shape[0]):
22419 : * raise ValueError("arrays in `prominence_data` must have the same shape "
22420 : */
22421 27 : __pyx_t_1 = ((__pyx_v_peaks.shape[0]) == (__pyx_v_prominences.shape[0]));
22422 27 : if (__pyx_t_1) {
22423 25 : __pyx_t_1 = ((__pyx_v_prominences.shape[0]) == (__pyx_v_left_bases.shape[0]));
22424 25 : if (__pyx_t_1) {
22425 :
22426 : /* "scipy/signal/_peak_finding_utils.pyx":326
22427 : * raise ValueError('`rel_height` must be greater or equal to 0.0')
22428 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0]
22429 : * == right_bases.shape[0]): # <<<<<<<<<<<<<<
22430 : * raise ValueError("arrays in `prominence_data` must have the same shape "
22431 : * "as `peaks`")
22432 : */
22433 24 : __pyx_t_1 = ((__pyx_v_left_bases.shape[0]) == (__pyx_v_right_bases.shape[0]));
22434 : }
22435 : }
22436 :
22437 : /* "scipy/signal/_peak_finding_utils.pyx":325
22438 : * if rel_height < 0:
22439 : * raise ValueError('`rel_height` must be greater or equal to 0.0')
22440 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0] # <<<<<<<<<<<<<<
22441 : * == right_bases.shape[0]):
22442 : * raise ValueError("arrays in `prominence_data` must have the same shape "
22443 : */
22444 27 : __pyx_t_3 = (!__pyx_t_1);
22445 27 : if (unlikely(__pyx_t_3)) {
22446 :
22447 : /* "scipy/signal/_peak_finding_utils.pyx":327
22448 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0]
22449 : * == right_bases.shape[0]):
22450 : * raise ValueError("arrays in `prominence_data` must have the same shape " # <<<<<<<<<<<<<<
22451 : * "as `peaks`")
22452 : *
22453 : */
22454 4 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error)
22455 4 : __Pyx_GOTREF(__pyx_t_2);
22456 4 : __Pyx_Raise(__pyx_t_2, 0, 0, 0);
22457 4 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22458 4 : __PYX_ERR(0, 327, __pyx_L1_error)
22459 :
22460 : /* "scipy/signal/_peak_finding_utils.pyx":325
22461 : * if rel_height < 0:
22462 : * raise ValueError('`rel_height` must be greater or equal to 0.0')
22463 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0] # <<<<<<<<<<<<<<
22464 : * == right_bases.shape[0]):
22465 : * raise ValueError("arrays in `prominence_data` must have the same shape "
22466 : */
22467 : }
22468 :
22469 : /* "scipy/signal/_peak_finding_utils.pyx":330
22470 : * "as `peaks`")
22471 : *
22472 : * show_warning = False # <<<<<<<<<<<<<<
22473 : * widths = np.empty(peaks.shape[0], dtype=np.float64)
22474 : * width_heights = np.empty(peaks.shape[0], dtype=np.float64)
22475 : */
22476 23 : __pyx_v_show_warning = 0;
22477 :
22478 : /* "scipy/signal/_peak_finding_utils.pyx":331
22479 : *
22480 : * show_warning = False
22481 : * widths = np.empty(peaks.shape[0], dtype=np.float64) # <<<<<<<<<<<<<<
22482 : * width_heights = np.empty(peaks.shape[0], dtype=np.float64)
22483 : * left_ips = np.empty(peaks.shape[0], dtype=np.float64)
22484 : */
22485 23 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
22486 23 : __Pyx_GOTREF(__pyx_t_2);
22487 23 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
22488 23 : __Pyx_GOTREF(__pyx_t_4);
22489 23 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22490 23 : __pyx_t_2 = PyInt_FromSsize_t((__pyx_v_peaks.shape[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
22491 23 : __Pyx_GOTREF(__pyx_t_2);
22492 23 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
22493 23 : __Pyx_GOTREF(__pyx_t_5);
22494 23 : __Pyx_GIVEREF(__pyx_t_2);
22495 23 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error);
22496 23 : __pyx_t_2 = 0;
22497 23 : __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
22498 23 : __Pyx_GOTREF(__pyx_t_2);
22499 23 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
22500 23 : __Pyx_GOTREF(__pyx_t_6);
22501 23 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
22502 23 : __Pyx_GOTREF(__pyx_t_7);
22503 23 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22504 23 : if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 331, __pyx_L1_error)
22505 23 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22506 23 : __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
22507 23 : __Pyx_GOTREF(__pyx_t_7);
22508 23 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22509 23 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22510 23 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22511 23 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_7, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 331, __pyx_L1_error)
22512 23 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22513 23 : __pyx_v_widths = __pyx_t_8;
22514 23 : __pyx_t_8.memview = NULL;
22515 23 : __pyx_t_8.data = NULL;
22516 :
22517 : /* "scipy/signal/_peak_finding_utils.pyx":332
22518 : * show_warning = False
22519 : * widths = np.empty(peaks.shape[0], dtype=np.float64)
22520 : * width_heights = np.empty(peaks.shape[0], dtype=np.float64) # <<<<<<<<<<<<<<
22521 : * left_ips = np.empty(peaks.shape[0], dtype=np.float64)
22522 : * right_ips = np.empty(peaks.shape[0], dtype=np.float64)
22523 : */
22524 23 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
22525 23 : __Pyx_GOTREF(__pyx_t_7);
22526 23 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
22527 23 : __Pyx_GOTREF(__pyx_t_2);
22528 23 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22529 23 : __pyx_t_7 = PyInt_FromSsize_t((__pyx_v_peaks.shape[0])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
22530 23 : __Pyx_GOTREF(__pyx_t_7);
22531 23 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
22532 23 : __Pyx_GOTREF(__pyx_t_5);
22533 23 : __Pyx_GIVEREF(__pyx_t_7);
22534 23 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error);
22535 23 : __pyx_t_7 = 0;
22536 23 : __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error)
22537 23 : __Pyx_GOTREF(__pyx_t_7);
22538 23 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 332, __pyx_L1_error)
22539 23 : __Pyx_GOTREF(__pyx_t_4);
22540 23 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
22541 23 : __Pyx_GOTREF(__pyx_t_6);
22542 23 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22543 23 : if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
22544 23 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22545 23 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 332, __pyx_L1_error)
22546 23 : __Pyx_GOTREF(__pyx_t_6);
22547 23 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22548 23 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22549 23 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22550 23 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 332, __pyx_L1_error)
22551 23 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22552 23 : __pyx_v_width_heights = __pyx_t_8;
22553 23 : __pyx_t_8.memview = NULL;
22554 23 : __pyx_t_8.data = NULL;
22555 :
22556 : /* "scipy/signal/_peak_finding_utils.pyx":333
22557 : * widths = np.empty(peaks.shape[0], dtype=np.float64)
22558 : * width_heights = np.empty(peaks.shape[0], dtype=np.float64)
22559 : * left_ips = np.empty(peaks.shape[0], dtype=np.float64) # <<<<<<<<<<<<<<
22560 : * right_ips = np.empty(peaks.shape[0], dtype=np.float64)
22561 : *
22562 : */
22563 23 : __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
22564 23 : __Pyx_GOTREF(__pyx_t_6);
22565 23 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error)
22566 23 : __Pyx_GOTREF(__pyx_t_7);
22567 23 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22568 23 : __pyx_t_6 = PyInt_FromSsize_t((__pyx_v_peaks.shape[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
22569 23 : __Pyx_GOTREF(__pyx_t_6);
22570 23 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error)
22571 23 : __Pyx_GOTREF(__pyx_t_5);
22572 23 : __Pyx_GIVEREF(__pyx_t_6);
22573 23 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error);
22574 23 : __pyx_t_6 = 0;
22575 23 : __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error)
22576 23 : __Pyx_GOTREF(__pyx_t_6);
22577 23 : __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
22578 23 : __Pyx_GOTREF(__pyx_t_2);
22579 23 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
22580 23 : __Pyx_GOTREF(__pyx_t_4);
22581 23 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22582 23 : if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 333, __pyx_L1_error)
22583 23 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22584 23 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
22585 23 : __Pyx_GOTREF(__pyx_t_4);
22586 23 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22587 23 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22588 23 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22589 23 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 333, __pyx_L1_error)
22590 23 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22591 23 : __pyx_v_left_ips = __pyx_t_8;
22592 23 : __pyx_t_8.memview = NULL;
22593 23 : __pyx_t_8.data = NULL;
22594 :
22595 : /* "scipy/signal/_peak_finding_utils.pyx":334
22596 : * width_heights = np.empty(peaks.shape[0], dtype=np.float64)
22597 : * left_ips = np.empty(peaks.shape[0], dtype=np.float64)
22598 : * right_ips = np.empty(peaks.shape[0], dtype=np.float64) # <<<<<<<<<<<<<<
22599 : *
22600 : * with nogil:
22601 : */
22602 23 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
22603 23 : __Pyx_GOTREF(__pyx_t_4);
22604 23 : __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
22605 23 : __Pyx_GOTREF(__pyx_t_6);
22606 23 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22607 23 : __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_peaks.shape[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
22608 23 : __Pyx_GOTREF(__pyx_t_4);
22609 23 : __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
22610 23 : __Pyx_GOTREF(__pyx_t_5);
22611 23 : __Pyx_GIVEREF(__pyx_t_4);
22612 23 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error);
22613 23 : __pyx_t_4 = 0;
22614 23 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
22615 23 : __Pyx_GOTREF(__pyx_t_4);
22616 23 : __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error)
22617 23 : __Pyx_GOTREF(__pyx_t_7);
22618 23 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error)
22619 23 : __Pyx_GOTREF(__pyx_t_2);
22620 23 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22621 23 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
22622 23 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22623 23 : __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error)
22624 23 : __Pyx_GOTREF(__pyx_t_2);
22625 23 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
22626 23 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22627 23 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22628 23 : __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 334, __pyx_L1_error)
22629 23 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22630 23 : __pyx_v_right_ips = __pyx_t_8;
22631 23 : __pyx_t_8.memview = NULL;
22632 23 : __pyx_t_8.data = NULL;
22633 :
22634 : /* "scipy/signal/_peak_finding_utils.pyx":336
22635 : * right_ips = np.empty(peaks.shape[0], dtype=np.float64)
22636 : *
22637 : * with nogil: # <<<<<<<<<<<<<<
22638 : * for p in range(peaks.shape[0]):
22639 : * i_min = left_bases[p]
22640 : */
22641 : {
22642 : #ifdef WITH_THREAD
22643 23 : PyThreadState *_save;
22644 23 : _save = NULL;
22645 23 : Py_UNBLOCK_THREADS
22646 23 : __Pyx_FastGIL_Remember();
22647 : #endif
22648 : /*try:*/ {
22649 :
22650 : /* "scipy/signal/_peak_finding_utils.pyx":337
22651 : *
22652 : * with nogil:
22653 : * for p in range(peaks.shape[0]): # <<<<<<<<<<<<<<
22654 : * i_min = left_bases[p]
22655 : * i_max = right_bases[p]
22656 : */
22657 23 : __pyx_t_9 = (__pyx_v_peaks.shape[0]);
22658 23 : __pyx_t_10 = __pyx_t_9;
22659 64 : for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
22660 21 : __pyx_v_p = __pyx_t_11;
22661 :
22662 : /* "scipy/signal/_peak_finding_utils.pyx":338
22663 : * with nogil:
22664 : * for p in range(peaks.shape[0]):
22665 : * i_min = left_bases[p] # <<<<<<<<<<<<<<
22666 : * i_max = right_bases[p]
22667 : * peak = peaks[p]
22668 : */
22669 21 : __pyx_t_12 = __pyx_v_p;
22670 21 : __pyx_v_i_min = (*((__pyx_t_5numpy_intp_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t const *) __pyx_v_left_bases.data) + __pyx_t_12)) )));
22671 :
22672 : /* "scipy/signal/_peak_finding_utils.pyx":339
22673 : * for p in range(peaks.shape[0]):
22674 : * i_min = left_bases[p]
22675 : * i_max = right_bases[p] # <<<<<<<<<<<<<<
22676 : * peak = peaks[p]
22677 : * # Validate bounds and order
22678 : */
22679 21 : __pyx_t_12 = __pyx_v_p;
22680 21 : __pyx_v_i_max = (*((__pyx_t_5numpy_intp_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t const *) __pyx_v_right_bases.data) + __pyx_t_12)) )));
22681 :
22682 : /* "scipy/signal/_peak_finding_utils.pyx":340
22683 : * i_min = left_bases[p]
22684 : * i_max = right_bases[p]
22685 : * peak = peaks[p] # <<<<<<<<<<<<<<
22686 : * # Validate bounds and order
22687 : * if not 0 <= i_min <= peak <= i_max < x.shape[0]:
22688 : */
22689 21 : __pyx_t_12 = __pyx_v_p;
22690 21 : __pyx_v_peak = (*((__pyx_t_5numpy_intp_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_intp_t const *) __pyx_v_peaks.data) + __pyx_t_12)) )));
22691 :
22692 : /* "scipy/signal/_peak_finding_utils.pyx":342
22693 : * peak = peaks[p]
22694 : * # Validate bounds and order
22695 : * if not 0 <= i_min <= peak <= i_max < x.shape[0]: # <<<<<<<<<<<<<<
22696 : * with gil:
22697 : * raise ValueError("prominence data is invalid for peak {}"
22698 : */
22699 21 : __pyx_t_3 = (0 <= __pyx_v_i_min);
22700 21 : if (__pyx_t_3) {
22701 20 : __pyx_t_3 = (__pyx_v_i_min <= __pyx_v_peak);
22702 20 : if (__pyx_t_3) {
22703 19 : __pyx_t_3 = (__pyx_v_peak <= __pyx_v_i_max);
22704 19 : if (__pyx_t_3) {
22705 19 : __pyx_t_3 = (__pyx_v_i_max < (__pyx_v_x.shape[0]));
22706 : }
22707 : }
22708 : }
22709 21 : __pyx_t_1 = (!__pyx_t_3);
22710 21 : if (unlikely(__pyx_t_1)) {
22711 :
22712 : /* "scipy/signal/_peak_finding_utils.pyx":343
22713 : * # Validate bounds and order
22714 : * if not 0 <= i_min <= peak <= i_max < x.shape[0]:
22715 : * with gil: # <<<<<<<<<<<<<<
22716 : * raise ValueError("prominence data is invalid for peak {}"
22717 : * .format(peak))
22718 : */
22719 : {
22720 : #ifdef WITH_THREAD
22721 3 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22722 : #endif
22723 : /*try:*/ {
22724 :
22725 : /* "scipy/signal/_peak_finding_utils.pyx":345
22726 : * with gil:
22727 : * raise ValueError("prominence data is invalid for peak {}"
22728 : * .format(peak)) # <<<<<<<<<<<<<<
22729 : * height = width_heights[p] = x[peak] - prominences[p] * rel_height
22730 : *
22731 : */
22732 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_prominence_data_is_invalid_for_p, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L14_error)
22733 3 : __Pyx_GOTREF(__pyx_t_4);
22734 3 : __pyx_t_5 = __Pyx_PyInt_From_npy_intp(__pyx_v_peak); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L14_error)
22735 3 : __Pyx_GOTREF(__pyx_t_5);
22736 3 : __pyx_t_6 = NULL;
22737 3 : __pyx_t_13 = 0;
22738 : #if CYTHON_UNPACK_METHODS
22739 3 : if (likely(PyMethod_Check(__pyx_t_4))) {
22740 0 : __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
22741 0 : if (likely(__pyx_t_6)) {
22742 0 : PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
22743 0 : __Pyx_INCREF(__pyx_t_6);
22744 0 : __Pyx_INCREF(function);
22745 0 : __Pyx_DECREF_SET(__pyx_t_4, function);
22746 : __pyx_t_13 = 1;
22747 : }
22748 : }
22749 : #endif
22750 : {
22751 3 : PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
22752 3 : __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
22753 3 : __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
22754 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22755 3 : if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L14_error)
22756 3 : __Pyx_GOTREF(__pyx_t_2);
22757 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22758 : }
22759 :
22760 : /* "scipy/signal/_peak_finding_utils.pyx":344
22761 : * if not 0 <= i_min <= peak <= i_max < x.shape[0]:
22762 : * with gil:
22763 : * raise ValueError("prominence data is invalid for peak {}" # <<<<<<<<<<<<<<
22764 : * .format(peak))
22765 : * height = width_heights[p] = x[peak] - prominences[p] * rel_height
22766 : */
22767 3 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L14_error)
22768 3 : __Pyx_GOTREF(__pyx_t_4);
22769 3 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22770 3 : __Pyx_Raise(__pyx_t_4, 0, 0, 0);
22771 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22772 3 : __PYX_ERR(0, 344, __pyx_L14_error)
22773 : }
22774 :
22775 : /* "scipy/signal/_peak_finding_utils.pyx":343
22776 : * # Validate bounds and order
22777 : * if not 0 <= i_min <= peak <= i_max < x.shape[0]:
22778 : * with gil: # <<<<<<<<<<<<<<
22779 : * raise ValueError("prominence data is invalid for peak {}"
22780 : * .format(peak))
22781 : */
22782 : /*finally:*/ {
22783 3 : __pyx_L14_error: {
22784 : #ifdef WITH_THREAD
22785 3 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
22786 : #endif
22787 3 : goto __pyx_L6_error;
22788 : }
22789 : }
22790 : }
22791 :
22792 : /* "scipy/signal/_peak_finding_utils.pyx":342
22793 : * peak = peaks[p]
22794 : * # Validate bounds and order
22795 : * if not 0 <= i_min <= peak <= i_max < x.shape[0]: # <<<<<<<<<<<<<<
22796 : * with gil:
22797 : * raise ValueError("prominence data is invalid for peak {}"
22798 : */
22799 : }
22800 :
22801 : /* "scipy/signal/_peak_finding_utils.pyx":346
22802 : * raise ValueError("prominence data is invalid for peak {}"
22803 : * .format(peak))
22804 : * height = width_heights[p] = x[peak] - prominences[p] * rel_height # <<<<<<<<<<<<<<
22805 : *
22806 : * # Find intersection point on left side
22807 : */
22808 18 : __pyx_t_12 = __pyx_v_peak;
22809 18 : __pyx_t_14 = __pyx_v_p;
22810 18 : __pyx_t_15 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_12)) ))) - ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_prominences.data) + __pyx_t_14)) ))) * __pyx_v_rel_height));
22811 18 : __pyx_v_height = __pyx_t_15;
22812 18 : __pyx_t_14 = __pyx_v_p;
22813 18 : *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_width_heights.data) + __pyx_t_14)) )) = __pyx_t_15;
22814 :
22815 : /* "scipy/signal/_peak_finding_utils.pyx":349
22816 : *
22817 : * # Find intersection point on left side
22818 : * i = peak # <<<<<<<<<<<<<<
22819 : * while i_min < i and height < x[i]:
22820 : * i -= 1
22821 : */
22822 18 : __pyx_v_i = __pyx_v_peak;
22823 :
22824 : /* "scipy/signal/_peak_finding_utils.pyx":350
22825 : * # Find intersection point on left side
22826 : * i = peak
22827 : * while i_min < i and height < x[i]: # <<<<<<<<<<<<<<
22828 : * i -= 1
22829 : * left_ip = <np.float64_t>i
22830 : */
22831 56 : while (1) {
22832 37 : __pyx_t_3 = (__pyx_v_i_min < __pyx_v_i);
22833 37 : if (__pyx_t_3) {
22834 25 : } else {
22835 12 : __pyx_t_1 = __pyx_t_3;
22836 12 : goto __pyx_L18_bool_binop_done;
22837 : }
22838 25 : __pyx_t_14 = __pyx_v_i;
22839 25 : __pyx_t_3 = (__pyx_v_height < (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_14)) ))));
22840 25 : __pyx_t_1 = __pyx_t_3;
22841 37 : __pyx_L18_bool_binop_done:;
22842 37 : if (!__pyx_t_1) break;
22843 :
22844 : /* "scipy/signal/_peak_finding_utils.pyx":351
22845 : * i = peak
22846 : * while i_min < i and height < x[i]:
22847 : * i -= 1 # <<<<<<<<<<<<<<
22848 : * left_ip = <np.float64_t>i
22849 : * if x[i] < height:
22850 : */
22851 19 : __pyx_v_i = (__pyx_v_i - 1);
22852 : }
22853 :
22854 : /* "scipy/signal/_peak_finding_utils.pyx":352
22855 : * while i_min < i and height < x[i]:
22856 : * i -= 1
22857 : * left_ip = <np.float64_t>i # <<<<<<<<<<<<<<
22858 : * if x[i] < height:
22859 : * # Interpolate if true intersection height is between samples
22860 : */
22861 18 : __pyx_v_left_ip = ((__pyx_t_5numpy_float64_t)__pyx_v_i);
22862 :
22863 : /* "scipy/signal/_peak_finding_utils.pyx":353
22864 : * i -= 1
22865 : * left_ip = <np.float64_t>i
22866 : * if x[i] < height: # <<<<<<<<<<<<<<
22867 : * # Interpolate if true intersection height is between samples
22868 : * left_ip += (height - x[i]) / (x[i + 1] - x[i])
22869 : */
22870 18 : __pyx_t_14 = __pyx_v_i;
22871 18 : __pyx_t_1 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_14)) ))) < __pyx_v_height);
22872 18 : if (__pyx_t_1) {
22873 :
22874 : /* "scipy/signal/_peak_finding_utils.pyx":355
22875 : * if x[i] < height:
22876 : * # Interpolate if true intersection height is between samples
22877 : * left_ip += (height - x[i]) / (x[i + 1] - x[i]) # <<<<<<<<<<<<<<
22878 : *
22879 : * # Find intersection point on right side
22880 : */
22881 8 : __pyx_t_14 = __pyx_v_i;
22882 8 : __pyx_t_15 = (__pyx_v_height - (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_14)) ))));
22883 8 : __pyx_t_14 = (__pyx_v_i + 1);
22884 8 : __pyx_t_12 = __pyx_v_i;
22885 8 : __pyx_t_16 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_14)) ))) - (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_12)) ))));
22886 8 : if (unlikely(__pyx_t_16 == 0)) {
22887 : #ifdef WITH_THREAD
22888 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22889 : #endif
22890 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
22891 : #ifdef WITH_THREAD
22892 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
22893 : #endif
22894 0 : __PYX_ERR(0, 355, __pyx_L6_error)
22895 : }
22896 8 : __pyx_v_left_ip = (__pyx_v_left_ip + (__pyx_t_15 / __pyx_t_16));
22897 :
22898 : /* "scipy/signal/_peak_finding_utils.pyx":353
22899 : * i -= 1
22900 : * left_ip = <np.float64_t>i
22901 : * if x[i] < height: # <<<<<<<<<<<<<<
22902 : * # Interpolate if true intersection height is between samples
22903 : * left_ip += (height - x[i]) / (x[i + 1] - x[i])
22904 : */
22905 : }
22906 :
22907 : /* "scipy/signal/_peak_finding_utils.pyx":358
22908 : *
22909 : * # Find intersection point on right side
22910 : * i = peak # <<<<<<<<<<<<<<
22911 : * while i < i_max and height < x[i]:
22912 : * i += 1
22913 : */
22914 18 : __pyx_v_i = __pyx_v_peak;
22915 :
22916 : /* "scipy/signal/_peak_finding_utils.pyx":359
22917 : * # Find intersection point on right side
22918 : * i = peak
22919 : * while i < i_max and height < x[i]: # <<<<<<<<<<<<<<
22920 : * i += 1
22921 : * right_ip = <np.float64_t>i
22922 : */
22923 62 : while (1) {
22924 40 : __pyx_t_3 = (__pyx_v_i < __pyx_v_i_max);
22925 40 : if (__pyx_t_3) {
22926 31 : } else {
22927 9 : __pyx_t_1 = __pyx_t_3;
22928 9 : goto __pyx_L23_bool_binop_done;
22929 : }
22930 31 : __pyx_t_12 = __pyx_v_i;
22931 31 : __pyx_t_3 = (__pyx_v_height < (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_12)) ))));
22932 31 : __pyx_t_1 = __pyx_t_3;
22933 40 : __pyx_L23_bool_binop_done:;
22934 40 : if (!__pyx_t_1) break;
22935 :
22936 : /* "scipy/signal/_peak_finding_utils.pyx":360
22937 : * i = peak
22938 : * while i < i_max and height < x[i]:
22939 : * i += 1 # <<<<<<<<<<<<<<
22940 : * right_ip = <np.float64_t>i
22941 : * if x[i] < height:
22942 : */
22943 22 : __pyx_v_i = (__pyx_v_i + 1);
22944 : }
22945 :
22946 : /* "scipy/signal/_peak_finding_utils.pyx":361
22947 : * while i < i_max and height < x[i]:
22948 : * i += 1
22949 : * right_ip = <np.float64_t>i # <<<<<<<<<<<<<<
22950 : * if x[i] < height:
22951 : * # Interpolate if true intersection height is between samples
22952 : */
22953 18 : __pyx_v_right_ip = ((__pyx_t_5numpy_float64_t)__pyx_v_i);
22954 :
22955 : /* "scipy/signal/_peak_finding_utils.pyx":362
22956 : * i += 1
22957 : * right_ip = <np.float64_t>i
22958 : * if x[i] < height: # <<<<<<<<<<<<<<
22959 : * # Interpolate if true intersection height is between samples
22960 : * right_ip -= (height - x[i]) / (x[i - 1] - x[i])
22961 : */
22962 18 : __pyx_t_12 = __pyx_v_i;
22963 18 : __pyx_t_1 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_12)) ))) < __pyx_v_height);
22964 18 : if (__pyx_t_1) {
22965 :
22966 : /* "scipy/signal/_peak_finding_utils.pyx":364
22967 : * if x[i] < height:
22968 : * # Interpolate if true intersection height is between samples
22969 : * right_ip -= (height - x[i]) / (x[i - 1] - x[i]) # <<<<<<<<<<<<<<
22970 : *
22971 : * widths[p] = right_ip - left_ip
22972 : */
22973 8 : __pyx_t_12 = __pyx_v_i;
22974 8 : __pyx_t_16 = (__pyx_v_height - (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_12)) ))));
22975 8 : __pyx_t_12 = (__pyx_v_i - 1);
22976 8 : __pyx_t_14 = __pyx_v_i;
22977 8 : __pyx_t_15 = ((*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_12)) ))) - (*((__pyx_t_5numpy_float64_t const *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t const *) __pyx_v_x.data) + __pyx_t_14)) ))));
22978 8 : if (unlikely(__pyx_t_15 == 0)) {
22979 : #ifdef WITH_THREAD
22980 0 : PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
22981 : #endif
22982 0 : PyErr_SetString(PyExc_ZeroDivisionError, "float division");
22983 : #ifdef WITH_THREAD
22984 0 : __Pyx_PyGILState_Release(__pyx_gilstate_save);
22985 : #endif
22986 0 : __PYX_ERR(0, 364, __pyx_L6_error)
22987 : }
22988 8 : __pyx_v_right_ip = (__pyx_v_right_ip - (__pyx_t_16 / __pyx_t_15));
22989 :
22990 : /* "scipy/signal/_peak_finding_utils.pyx":362
22991 : * i += 1
22992 : * right_ip = <np.float64_t>i
22993 : * if x[i] < height: # <<<<<<<<<<<<<<
22994 : * # Interpolate if true intersection height is between samples
22995 : * right_ip -= (height - x[i]) / (x[i - 1] - x[i])
22996 : */
22997 : }
22998 :
22999 : /* "scipy/signal/_peak_finding_utils.pyx":366
23000 : * right_ip -= (height - x[i]) / (x[i - 1] - x[i])
23001 : *
23002 : * widths[p] = right_ip - left_ip # <<<<<<<<<<<<<<
23003 : * if widths[p] == 0:
23004 : * show_warning = True
23005 : */
23006 18 : __pyx_t_14 = __pyx_v_p;
23007 18 : *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_widths.data) + __pyx_t_14)) )) = (__pyx_v_right_ip - __pyx_v_left_ip);
23008 :
23009 : /* "scipy/signal/_peak_finding_utils.pyx":367
23010 : *
23011 : * widths[p] = right_ip - left_ip
23012 : * if widths[p] == 0: # <<<<<<<<<<<<<<
23013 : * show_warning = True
23014 : * left_ips[p] = left_ip
23015 : */
23016 18 : __pyx_t_14 = __pyx_v_p;
23017 18 : __pyx_t_1 = ((*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_widths.data) + __pyx_t_14)) ))) == 0.0);
23018 18 : if (__pyx_t_1) {
23019 :
23020 : /* "scipy/signal/_peak_finding_utils.pyx":368
23021 : * widths[p] = right_ip - left_ip
23022 : * if widths[p] == 0:
23023 : * show_warning = True # <<<<<<<<<<<<<<
23024 : * left_ips[p] = left_ip
23025 : * right_ips[p] = right_ip
23026 : */
23027 5 : __pyx_v_show_warning = 1;
23028 :
23029 : /* "scipy/signal/_peak_finding_utils.pyx":367
23030 : *
23031 : * widths[p] = right_ip - left_ip
23032 : * if widths[p] == 0: # <<<<<<<<<<<<<<
23033 : * show_warning = True
23034 : * left_ips[p] = left_ip
23035 : */
23036 : }
23037 :
23038 : /* "scipy/signal/_peak_finding_utils.pyx":369
23039 : * if widths[p] == 0:
23040 : * show_warning = True
23041 : * left_ips[p] = left_ip # <<<<<<<<<<<<<<
23042 : * right_ips[p] = right_ip
23043 : *
23044 : */
23045 18 : __pyx_t_14 = __pyx_v_p;
23046 18 : *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_left_ips.data) + __pyx_t_14)) )) = __pyx_v_left_ip;
23047 :
23048 : /* "scipy/signal/_peak_finding_utils.pyx":370
23049 : * show_warning = True
23050 : * left_ips[p] = left_ip
23051 : * right_ips[p] = right_ip # <<<<<<<<<<<<<<
23052 : *
23053 : * if show_warning:
23054 : */
23055 18 : __pyx_t_14 = __pyx_v_p;
23056 18 : *((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_float64_t *) __pyx_v_right_ips.data) + __pyx_t_14)) )) = __pyx_v_right_ip;
23057 : }
23058 : }
23059 :
23060 : /* "scipy/signal/_peak_finding_utils.pyx":336
23061 : * right_ips = np.empty(peaks.shape[0], dtype=np.float64)
23062 : *
23063 : * with nogil: # <<<<<<<<<<<<<<
23064 : * for p in range(peaks.shape[0]):
23065 : * i_min = left_bases[p]
23066 : */
23067 : /*finally:*/ {
23068 : /*normal exit:*/{
23069 : #ifdef WITH_THREAD
23070 20 : __Pyx_FastGIL_Forget();
23071 20 : Py_BLOCK_THREADS
23072 : #endif
23073 20 : goto __pyx_L7;
23074 : }
23075 3 : __pyx_L6_error: {
23076 : #ifdef WITH_THREAD
23077 3 : __Pyx_FastGIL_Forget();
23078 3 : Py_BLOCK_THREADS
23079 : #endif
23080 3 : goto __pyx_L1_error;
23081 : }
23082 20 : __pyx_L7:;
23083 : }
23084 : }
23085 :
23086 : /* "scipy/signal/_peak_finding_utils.pyx":372
23087 : * right_ips[p] = right_ip
23088 : *
23089 : * if show_warning: # <<<<<<<<<<<<<<
23090 : * warnings.warn("some peaks have a width of 0",
23091 : * PeakPropertyWarning, stacklevel=2)
23092 : */
23093 20 : __pyx_t_1 = (__pyx_v_show_warning != 0);
23094 20 : if (__pyx_t_1) {
23095 :
23096 : /* "scipy/signal/_peak_finding_utils.pyx":373
23097 : *
23098 : * if show_warning:
23099 : * warnings.warn("some peaks have a width of 0", # <<<<<<<<<<<<<<
23100 : * PeakPropertyWarning, stacklevel=2)
23101 : * return widths.base, width_heights.base, left_ips.base, right_ips.base
23102 : */
23103 5 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_warnings); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error)
23104 5 : __Pyx_GOTREF(__pyx_t_4);
23105 5 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error)
23106 5 : __Pyx_GOTREF(__pyx_t_2);
23107 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23108 :
23109 : /* "scipy/signal/_peak_finding_utils.pyx":374
23110 : * if show_warning:
23111 : * warnings.warn("some peaks have a width of 0",
23112 : * PeakPropertyWarning, stacklevel=2) # <<<<<<<<<<<<<<
23113 : * return widths.base, width_heights.base, left_ips.base, right_ips.base
23114 : */
23115 5 : __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PeakPropertyWarning); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error)
23116 5 : __Pyx_GOTREF(__pyx_t_4);
23117 :
23118 : /* "scipy/signal/_peak_finding_utils.pyx":373
23119 : *
23120 : * if show_warning:
23121 : * warnings.warn("some peaks have a width of 0", # <<<<<<<<<<<<<<
23122 : * PeakPropertyWarning, stacklevel=2)
23123 : * return widths.base, width_heights.base, left_ips.base, right_ips.base
23124 : */
23125 5 : __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error)
23126 5 : __Pyx_GOTREF(__pyx_t_5);
23127 5 : __Pyx_INCREF(__pyx_kp_u_some_peaks_have_a_width_of_0);
23128 5 : __Pyx_GIVEREF(__pyx_kp_u_some_peaks_have_a_width_of_0);
23129 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_some_peaks_have_a_width_of_0)) __PYX_ERR(0, 373, __pyx_L1_error);
23130 5 : __Pyx_GIVEREF(__pyx_t_4);
23131 5 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error);
23132 5 : __pyx_t_4 = 0;
23133 :
23134 : /* "scipy/signal/_peak_finding_utils.pyx":374
23135 : * if show_warning:
23136 : * warnings.warn("some peaks have a width of 0",
23137 : * PeakPropertyWarning, stacklevel=2) # <<<<<<<<<<<<<<
23138 : * return widths.base, width_heights.base, left_ips.base, right_ips.base
23139 : */
23140 5 : __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error)
23141 5 : __Pyx_GOTREF(__pyx_t_4);
23142 5 : if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_stacklevel, __pyx_int_2) < 0) __PYX_ERR(0, 374, __pyx_L1_error)
23143 :
23144 : /* "scipy/signal/_peak_finding_utils.pyx":373
23145 : *
23146 : * if show_warning:
23147 : * warnings.warn("some peaks have a width of 0", # <<<<<<<<<<<<<<
23148 : * PeakPropertyWarning, stacklevel=2)
23149 : * return widths.base, width_heights.base, left_ips.base, right_ips.base
23150 : */
23151 5 : __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error)
23152 5 : __Pyx_GOTREF(__pyx_t_6);
23153 5 : __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23154 5 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23155 5 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
23156 5 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23157 :
23158 : /* "scipy/signal/_peak_finding_utils.pyx":372
23159 : * right_ips[p] = right_ip
23160 : *
23161 : * if show_warning: # <<<<<<<<<<<<<<
23162 : * warnings.warn("some peaks have a width of 0",
23163 : * PeakPropertyWarning, stacklevel=2)
23164 : */
23165 : }
23166 :
23167 : /* "scipy/signal/_peak_finding_utils.pyx":375
23168 : * warnings.warn("some peaks have a width of 0",
23169 : * PeakPropertyWarning, stacklevel=2)
23170 : * return widths.base, width_heights.base, left_ips.base, right_ips.base # <<<<<<<<<<<<<<
23171 : */
23172 20 : __Pyx_XDECREF(__pyx_r);
23173 20 : __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_widths, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
23174 20 : __Pyx_GOTREF(__pyx_t_6);
23175 20 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error)
23176 20 : __Pyx_GOTREF(__pyx_t_4);
23177 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23178 20 : __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_width_heights, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
23179 20 : __Pyx_GOTREF(__pyx_t_6);
23180 20 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_base); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
23181 20 : __Pyx_GOTREF(__pyx_t_5);
23182 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23183 20 : __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_left_ips, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
23184 20 : __Pyx_GOTREF(__pyx_t_6);
23185 20 : __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
23186 20 : __Pyx_GOTREF(__pyx_t_2);
23187 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23188 20 : __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_right_ips, 1, (PyObject *(*)(char *)) __pyx_memview_get_nn___pyx_t_5numpy_float64_t, (int (*)(char *, PyObject *)) __pyx_memview_set_nn___pyx_t_5numpy_float64_t, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
23189 20 : __Pyx_GOTREF(__pyx_t_6);
23190 20 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_base); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error)
23191 20 : __Pyx_GOTREF(__pyx_t_7);
23192 20 : __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
23193 20 : __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
23194 20 : __Pyx_GOTREF(__pyx_t_6);
23195 20 : __Pyx_GIVEREF(__pyx_t_4);
23196 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 375, __pyx_L1_error);
23197 20 : __Pyx_GIVEREF(__pyx_t_5);
23198 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error);
23199 20 : __Pyx_GIVEREF(__pyx_t_2);
23200 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error);
23201 20 : __Pyx_GIVEREF(__pyx_t_7);
23202 20 : if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error);
23203 20 : __pyx_t_4 = 0;
23204 20 : __pyx_t_5 = 0;
23205 20 : __pyx_t_2 = 0;
23206 20 : __pyx_t_7 = 0;
23207 20 : __pyx_r = __pyx_t_6;
23208 20 : __pyx_t_6 = 0;
23209 20 : goto __pyx_L0;
23210 :
23211 : /* "scipy/signal/_peak_finding_utils.pyx":264
23212 : *
23213 : *
23214 : * def _peak_widths(const np.float64_t[::1] x not None, # <<<<<<<<<<<<<<
23215 : * const np.intp_t[::1] peaks not None,
23216 : * np.float64_t rel_height,
23217 : */
23218 :
23219 : /* function exit code */
23220 8 : __pyx_L1_error:;
23221 8 : __Pyx_XDECREF(__pyx_t_2);
23222 8 : __Pyx_XDECREF(__pyx_t_4);
23223 8 : __Pyx_XDECREF(__pyx_t_5);
23224 8 : __Pyx_XDECREF(__pyx_t_6);
23225 8 : __Pyx_XDECREF(__pyx_t_7);
23226 8 : __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
23227 8 : __Pyx_AddTraceback("scipy.signal._peak_finding_utils._peak_widths", __pyx_clineno, __pyx_lineno, __pyx_filename);
23228 8 : __pyx_r = NULL;
23229 28 : __pyx_L0:;
23230 28 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_widths, 1);
23231 28 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_width_heights, 1);
23232 28 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_left_ips, 1);
23233 28 : __PYX_XCLEAR_MEMVIEW(&__pyx_v_right_ips, 1);
23234 28 : __Pyx_XGIVEREF(__pyx_r);
23235 28 : __Pyx_RefNannyFinishContext();
23236 28 : return __pyx_r;
23237 : }
23238 : static struct __pyx_vtabstruct_array __pyx_vtable_array;
23239 :
23240 0 : static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
23241 0 : struct __pyx_array_obj *p;
23242 0 : PyObject *o;
23243 : #if CYTHON_COMPILING_IN_LIMITED_API
23244 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
23245 : o = alloc_func(t, 0);
23246 : #else
23247 0 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
23248 0 : o = (*t->tp_alloc)(t, 0);
23249 : } else {
23250 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
23251 : }
23252 0 : if (unlikely(!o)) return 0;
23253 : #endif
23254 0 : p = ((struct __pyx_array_obj *)o);
23255 0 : p->__pyx_vtab = __pyx_vtabptr_array;
23256 0 : p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
23257 0 : p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
23258 0 : if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
23259 : return o;
23260 0 : bad:
23261 0 : Py_DECREF(o); o = 0;
23262 : return NULL;
23263 : }
23264 :
23265 0 : static void __pyx_tp_dealloc_array(PyObject *o) {
23266 0 : struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
23267 : #if CYTHON_USE_TP_FINALIZE
23268 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
23269 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_array) {
23270 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
23271 : }
23272 : }
23273 : #endif
23274 : {
23275 0 : PyObject *etype, *eval, *etb;
23276 0 : PyErr_Fetch(&etype, &eval, &etb);
23277 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
23278 0 : __pyx_array___dealloc__(o);
23279 0 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
23280 0 : PyErr_Restore(etype, eval, etb);
23281 : }
23282 0 : Py_CLEAR(p->mode);
23283 0 : Py_CLEAR(p->_format);
23284 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
23285 0 : (*Py_TYPE(o)->tp_free)(o);
23286 : #else
23287 : {
23288 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
23289 : if (tp_free) tp_free(o);
23290 : }
23291 : #endif
23292 : }
23293 0 : static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
23294 0 : PyObject *r;
23295 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
23296 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
23297 0 : Py_DECREF(x);
23298 : return r;
23299 : }
23300 :
23301 0 : static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
23302 0 : if (v) {
23303 0 : return __pyx_array___setitem__(o, i, v);
23304 : }
23305 : else {
23306 0 : __Pyx_TypeName o_type_name;
23307 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
23308 0 : PyErr_Format(PyExc_NotImplementedError,
23309 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
23310 0 : __Pyx_DECREF_TypeName(o_type_name);
23311 0 : return -1;
23312 : }
23313 : }
23314 :
23315 0 : static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
23316 0 : PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
23317 0 : if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23318 0 : PyErr_Clear();
23319 0 : v = __pyx_array___getattr__(o, n);
23320 : }
23321 0 : return v;
23322 : }
23323 :
23324 0 : static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
23325 0 : return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
23326 : }
23327 :
23328 : static PyMethodDef __pyx_methods_array[] = {
23329 : {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
23330 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23331 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_array_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23332 : {0, 0, 0, 0}
23333 : };
23334 :
23335 : static struct PyGetSetDef __pyx_getsets_array[] = {
23336 : {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
23337 : {0, 0, 0, 0, 0}
23338 : };
23339 : #if CYTHON_USE_TYPE_SPECS
23340 : #if !CYTHON_COMPILING_IN_LIMITED_API
23341 :
23342 : static PyBufferProcs __pyx_tp_as_buffer_array = {
23343 : #if PY_MAJOR_VERSION < 3
23344 : 0, /*bf_getreadbuffer*/
23345 : #endif
23346 : #if PY_MAJOR_VERSION < 3
23347 : 0, /*bf_getwritebuffer*/
23348 : #endif
23349 : #if PY_MAJOR_VERSION < 3
23350 : 0, /*bf_getsegcount*/
23351 : #endif
23352 : #if PY_MAJOR_VERSION < 3
23353 : 0, /*bf_getcharbuffer*/
23354 : #endif
23355 : __pyx_array_getbuffer, /*bf_getbuffer*/
23356 : 0, /*bf_releasebuffer*/
23357 : };
23358 : #endif
23359 : static PyType_Slot __pyx_type___pyx_array_slots[] = {
23360 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_array},
23361 : {Py_sq_length, (void *)__pyx_array___len__},
23362 : {Py_sq_item, (void *)__pyx_sq_item_array},
23363 : {Py_mp_length, (void *)__pyx_array___len__},
23364 : {Py_mp_subscript, (void *)__pyx_array___getitem__},
23365 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_array},
23366 : {Py_tp_getattro, (void *)__pyx_tp_getattro_array},
23367 : #if defined(Py_bf_getbuffer)
23368 : {Py_bf_getbuffer, (void *)__pyx_array_getbuffer},
23369 : #endif
23370 : {Py_tp_methods, (void *)__pyx_methods_array},
23371 : {Py_tp_getset, (void *)__pyx_getsets_array},
23372 : {Py_tp_new, (void *)__pyx_tp_new_array},
23373 : {0, 0},
23374 : };
23375 : static PyType_Spec __pyx_type___pyx_array_spec = {
23376 : "scipy.signal._peak_finding_utils.array",
23377 : sizeof(struct __pyx_array_obj),
23378 : 0,
23379 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE,
23380 : __pyx_type___pyx_array_slots,
23381 : };
23382 : #else
23383 :
23384 : static PySequenceMethods __pyx_tp_as_sequence_array = {
23385 : __pyx_array___len__, /*sq_length*/
23386 : 0, /*sq_concat*/
23387 : 0, /*sq_repeat*/
23388 : __pyx_sq_item_array, /*sq_item*/
23389 : 0, /*sq_slice*/
23390 : 0, /*sq_ass_item*/
23391 : 0, /*sq_ass_slice*/
23392 : 0, /*sq_contains*/
23393 : 0, /*sq_inplace_concat*/
23394 : 0, /*sq_inplace_repeat*/
23395 : };
23396 :
23397 : static PyMappingMethods __pyx_tp_as_mapping_array = {
23398 : __pyx_array___len__, /*mp_length*/
23399 : __pyx_array___getitem__, /*mp_subscript*/
23400 : __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
23401 : };
23402 :
23403 : static PyBufferProcs __pyx_tp_as_buffer_array = {
23404 : #if PY_MAJOR_VERSION < 3
23405 : 0, /*bf_getreadbuffer*/
23406 : #endif
23407 : #if PY_MAJOR_VERSION < 3
23408 : 0, /*bf_getwritebuffer*/
23409 : #endif
23410 : #if PY_MAJOR_VERSION < 3
23411 : 0, /*bf_getsegcount*/
23412 : #endif
23413 : #if PY_MAJOR_VERSION < 3
23414 : 0, /*bf_getcharbuffer*/
23415 : #endif
23416 : __pyx_array_getbuffer, /*bf_getbuffer*/
23417 : 0, /*bf_releasebuffer*/
23418 : };
23419 :
23420 : static PyTypeObject __pyx_type___pyx_array = {
23421 : PyVarObject_HEAD_INIT(0, 0)
23422 : "scipy.signal._peak_finding_utils.""array", /*tp_name*/
23423 : sizeof(struct __pyx_array_obj), /*tp_basicsize*/
23424 : 0, /*tp_itemsize*/
23425 : __pyx_tp_dealloc_array, /*tp_dealloc*/
23426 : #if PY_VERSION_HEX < 0x030800b4
23427 : 0, /*tp_print*/
23428 : #endif
23429 : #if PY_VERSION_HEX >= 0x030800b4
23430 : 0, /*tp_vectorcall_offset*/
23431 : #endif
23432 : 0, /*tp_getattr*/
23433 : 0, /*tp_setattr*/
23434 : #if PY_MAJOR_VERSION < 3
23435 : 0, /*tp_compare*/
23436 : #endif
23437 : #if PY_MAJOR_VERSION >= 3
23438 : 0, /*tp_as_async*/
23439 : #endif
23440 : 0, /*tp_repr*/
23441 : 0, /*tp_as_number*/
23442 : &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
23443 : &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
23444 : 0, /*tp_hash*/
23445 : 0, /*tp_call*/
23446 : 0, /*tp_str*/
23447 : __pyx_tp_getattro_array, /*tp_getattro*/
23448 : 0, /*tp_setattro*/
23449 : &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
23450 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
23451 : 0, /*tp_doc*/
23452 : 0, /*tp_traverse*/
23453 : 0, /*tp_clear*/
23454 : 0, /*tp_richcompare*/
23455 : 0, /*tp_weaklistoffset*/
23456 : 0, /*tp_iter*/
23457 : 0, /*tp_iternext*/
23458 : __pyx_methods_array, /*tp_methods*/
23459 : 0, /*tp_members*/
23460 : __pyx_getsets_array, /*tp_getset*/
23461 : 0, /*tp_base*/
23462 : 0, /*tp_dict*/
23463 : 0, /*tp_descr_get*/
23464 : 0, /*tp_descr_set*/
23465 : #if !CYTHON_USE_TYPE_SPECS
23466 : 0, /*tp_dictoffset*/
23467 : #endif
23468 : 0, /*tp_init*/
23469 : 0, /*tp_alloc*/
23470 : __pyx_tp_new_array, /*tp_new*/
23471 : 0, /*tp_free*/
23472 : 0, /*tp_is_gc*/
23473 : 0, /*tp_bases*/
23474 : 0, /*tp_mro*/
23475 : 0, /*tp_cache*/
23476 : 0, /*tp_subclasses*/
23477 : 0, /*tp_weaklist*/
23478 : 0, /*tp_del*/
23479 : 0, /*tp_version_tag*/
23480 : #if PY_VERSION_HEX >= 0x030400a1
23481 : #if CYTHON_USE_TP_FINALIZE
23482 : 0, /*tp_finalize*/
23483 : #else
23484 : NULL, /*tp_finalize*/
23485 : #endif
23486 : #endif
23487 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
23488 : 0, /*tp_vectorcall*/
23489 : #endif
23490 : #if __PYX_NEED_TP_PRINT_SLOT == 1
23491 : 0, /*tp_print*/
23492 : #endif
23493 : #if PY_VERSION_HEX >= 0x030C0000
23494 : 0, /*tp_watched*/
23495 : #endif
23496 : #if PY_VERSION_HEX >= 0x030d00A4
23497 : 0, /*tp_versions_used*/
23498 : #endif
23499 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
23500 : 0, /*tp_pypy_flags*/
23501 : #endif
23502 : };
23503 : #endif
23504 :
23505 15 : static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
23506 15 : struct __pyx_MemviewEnum_obj *p;
23507 15 : PyObject *o;
23508 : #if CYTHON_COMPILING_IN_LIMITED_API
23509 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
23510 : o = alloc_func(t, 0);
23511 : #else
23512 15 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
23513 15 : o = (*t->tp_alloc)(t, 0);
23514 : } else {
23515 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
23516 : }
23517 15 : if (unlikely(!o)) return 0;
23518 : #endif
23519 15 : p = ((struct __pyx_MemviewEnum_obj *)o);
23520 15 : p->name = Py_None; Py_INCREF(Py_None);
23521 : return o;
23522 : }
23523 :
23524 0 : static void __pyx_tp_dealloc_Enum(PyObject *o) {
23525 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
23526 : #if CYTHON_USE_TP_FINALIZE
23527 0 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
23528 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_Enum) {
23529 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
23530 : }
23531 : }
23532 : #endif
23533 0 : PyObject_GC_UnTrack(o);
23534 0 : Py_CLEAR(p->name);
23535 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
23536 0 : (*Py_TYPE(o)->tp_free)(o);
23537 : #else
23538 : {
23539 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
23540 : if (tp_free) tp_free(o);
23541 : }
23542 : #endif
23543 : }
23544 :
23545 455 : static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
23546 455 : int e;
23547 455 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
23548 455 : if (p->name) {
23549 455 : e = (*v)(p->name, a); if (e) return e;
23550 : }
23551 : return 0;
23552 : }
23553 :
23554 0 : static int __pyx_tp_clear_Enum(PyObject *o) {
23555 0 : PyObject* tmp;
23556 0 : struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
23557 0 : tmp = ((PyObject*)p->name);
23558 0 : p->name = Py_None; Py_INCREF(Py_None);
23559 0 : Py_XDECREF(tmp);
23560 0 : return 0;
23561 : }
23562 :
23563 0 : static PyObject *__pyx_specialmethod___pyx_MemviewEnum___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
23564 0 : return __pyx_MemviewEnum___repr__(self);
23565 : }
23566 :
23567 : static PyMethodDef __pyx_methods_Enum[] = {
23568 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_MemviewEnum___repr__, METH_NOARGS|METH_COEXIST, 0},
23569 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23570 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23571 : {0, 0, 0, 0}
23572 : };
23573 : #if CYTHON_USE_TYPE_SPECS
23574 : static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = {
23575 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_Enum},
23576 : {Py_tp_repr, (void *)__pyx_MemviewEnum___repr__},
23577 : {Py_tp_traverse, (void *)__pyx_tp_traverse_Enum},
23578 : {Py_tp_clear, (void *)__pyx_tp_clear_Enum},
23579 : {Py_tp_methods, (void *)__pyx_methods_Enum},
23580 : {Py_tp_init, (void *)__pyx_MemviewEnum___init__},
23581 : {Py_tp_new, (void *)__pyx_tp_new_Enum},
23582 : {0, 0},
23583 : };
23584 : static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = {
23585 : "scipy.signal._peak_finding_utils.Enum",
23586 : sizeof(struct __pyx_MemviewEnum_obj),
23587 : 0,
23588 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23589 : __pyx_type___pyx_MemviewEnum_slots,
23590 : };
23591 : #else
23592 :
23593 : static PyTypeObject __pyx_type___pyx_MemviewEnum = {
23594 : PyVarObject_HEAD_INIT(0, 0)
23595 : "scipy.signal._peak_finding_utils.""Enum", /*tp_name*/
23596 : sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
23597 : 0, /*tp_itemsize*/
23598 : __pyx_tp_dealloc_Enum, /*tp_dealloc*/
23599 : #if PY_VERSION_HEX < 0x030800b4
23600 : 0, /*tp_print*/
23601 : #endif
23602 : #if PY_VERSION_HEX >= 0x030800b4
23603 : 0, /*tp_vectorcall_offset*/
23604 : #endif
23605 : 0, /*tp_getattr*/
23606 : 0, /*tp_setattr*/
23607 : #if PY_MAJOR_VERSION < 3
23608 : 0, /*tp_compare*/
23609 : #endif
23610 : #if PY_MAJOR_VERSION >= 3
23611 : 0, /*tp_as_async*/
23612 : #endif
23613 : __pyx_MemviewEnum___repr__, /*tp_repr*/
23614 : 0, /*tp_as_number*/
23615 : 0, /*tp_as_sequence*/
23616 : 0, /*tp_as_mapping*/
23617 : 0, /*tp_hash*/
23618 : 0, /*tp_call*/
23619 : 0, /*tp_str*/
23620 : 0, /*tp_getattro*/
23621 : 0, /*tp_setattro*/
23622 : 0, /*tp_as_buffer*/
23623 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23624 : 0, /*tp_doc*/
23625 : __pyx_tp_traverse_Enum, /*tp_traverse*/
23626 : __pyx_tp_clear_Enum, /*tp_clear*/
23627 : 0, /*tp_richcompare*/
23628 : 0, /*tp_weaklistoffset*/
23629 : 0, /*tp_iter*/
23630 : 0, /*tp_iternext*/
23631 : __pyx_methods_Enum, /*tp_methods*/
23632 : 0, /*tp_members*/
23633 : 0, /*tp_getset*/
23634 : 0, /*tp_base*/
23635 : 0, /*tp_dict*/
23636 : 0, /*tp_descr_get*/
23637 : 0, /*tp_descr_set*/
23638 : #if !CYTHON_USE_TYPE_SPECS
23639 : 0, /*tp_dictoffset*/
23640 : #endif
23641 : __pyx_MemviewEnum___init__, /*tp_init*/
23642 : 0, /*tp_alloc*/
23643 : __pyx_tp_new_Enum, /*tp_new*/
23644 : 0, /*tp_free*/
23645 : 0, /*tp_is_gc*/
23646 : 0, /*tp_bases*/
23647 : 0, /*tp_mro*/
23648 : 0, /*tp_cache*/
23649 : 0, /*tp_subclasses*/
23650 : 0, /*tp_weaklist*/
23651 : 0, /*tp_del*/
23652 : 0, /*tp_version_tag*/
23653 : #if PY_VERSION_HEX >= 0x030400a1
23654 : #if CYTHON_USE_TP_FINALIZE
23655 : 0, /*tp_finalize*/
23656 : #else
23657 : NULL, /*tp_finalize*/
23658 : #endif
23659 : #endif
23660 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
23661 : 0, /*tp_vectorcall*/
23662 : #endif
23663 : #if __PYX_NEED_TP_PRINT_SLOT == 1
23664 : 0, /*tp_print*/
23665 : #endif
23666 : #if PY_VERSION_HEX >= 0x030C0000
23667 : 0, /*tp_watched*/
23668 : #endif
23669 : #if PY_VERSION_HEX >= 0x030d00A4
23670 : 0, /*tp_versions_used*/
23671 : #endif
23672 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
23673 : 0, /*tp_pypy_flags*/
23674 : #endif
23675 : };
23676 : #endif
23677 : static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
23678 :
23679 1066 : static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
23680 1066 : struct __pyx_memoryview_obj *p;
23681 1066 : PyObject *o;
23682 : #if CYTHON_COMPILING_IN_LIMITED_API
23683 : allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
23684 : o = alloc_func(t, 0);
23685 : #else
23686 1066 : if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
23687 1066 : o = (*t->tp_alloc)(t, 0);
23688 : } else {
23689 0 : o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
23690 : }
23691 1066 : if (unlikely(!o)) return 0;
23692 : #endif
23693 1066 : p = ((struct __pyx_memoryview_obj *)o);
23694 1066 : p->__pyx_vtab = __pyx_vtabptr_memoryview;
23695 1066 : p->obj = Py_None; Py_INCREF(Py_None);
23696 1066 : p->_size = Py_None; Py_INCREF(Py_None);
23697 1066 : p->_array_interface = Py_None; Py_INCREF(Py_None);
23698 1066 : p->view.obj = NULL;
23699 1066 : if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
23700 : return o;
23701 1 : bad:
23702 1 : Py_DECREF(o); o = 0;
23703 : return NULL;
23704 : }
23705 :
23706 1066 : static void __pyx_tp_dealloc_memoryview(PyObject *o) {
23707 1066 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
23708 : #if CYTHON_USE_TP_FINALIZE
23709 1066 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
23710 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_memoryview) {
23711 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
23712 : }
23713 : }
23714 : #endif
23715 1066 : PyObject_GC_UnTrack(o);
23716 : {
23717 1066 : PyObject *etype, *eval, *etb;
23718 1066 : PyErr_Fetch(&etype, &eval, &etb);
23719 1066 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
23720 1066 : __pyx_memoryview___dealloc__(o);
23721 1066 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
23722 1066 : PyErr_Restore(etype, eval, etb);
23723 : }
23724 1066 : Py_CLEAR(p->obj);
23725 1066 : Py_CLEAR(p->_size);
23726 1066 : Py_CLEAR(p->_array_interface);
23727 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
23728 1066 : (*Py_TYPE(o)->tp_free)(o);
23729 : #else
23730 : {
23731 : freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
23732 : if (tp_free) tp_free(o);
23733 : }
23734 : #endif
23735 : }
23736 :
23737 0 : static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
23738 0 : int e;
23739 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
23740 0 : if (p->obj) {
23741 0 : e = (*v)(p->obj, a); if (e) return e;
23742 : }
23743 0 : if (p->_size) {
23744 0 : e = (*v)(p->_size, a); if (e) return e;
23745 : }
23746 0 : if (p->_array_interface) {
23747 0 : e = (*v)(p->_array_interface, a); if (e) return e;
23748 : }
23749 0 : if (p->view.obj) {
23750 0 : e = (*v)(p->view.obj, a); if (e) return e;
23751 : }
23752 : return 0;
23753 : }
23754 :
23755 0 : static int __pyx_tp_clear_memoryview(PyObject *o) {
23756 0 : PyObject* tmp;
23757 0 : struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
23758 0 : tmp = ((PyObject*)p->obj);
23759 0 : p->obj = Py_None; Py_INCREF(Py_None);
23760 0 : Py_XDECREF(tmp);
23761 0 : tmp = ((PyObject*)p->_size);
23762 0 : p->_size = Py_None; Py_INCREF(Py_None);
23763 0 : Py_XDECREF(tmp);
23764 0 : tmp = ((PyObject*)p->_array_interface);
23765 0 : p->_array_interface = Py_None; Py_INCREF(Py_None);
23766 0 : Py_XDECREF(tmp);
23767 0 : Py_CLEAR(p->view.obj);
23768 0 : return 0;
23769 : }
23770 0 : static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
23771 0 : PyObject *r;
23772 0 : PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
23773 0 : r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
23774 0 : Py_DECREF(x);
23775 : return r;
23776 : }
23777 :
23778 0 : static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
23779 0 : if (v) {
23780 0 : return __pyx_memoryview___setitem__(o, i, v);
23781 : }
23782 : else {
23783 0 : __Pyx_TypeName o_type_name;
23784 0 : o_type_name = __Pyx_PyType_GetName(Py_TYPE(o));
23785 0 : PyErr_Format(PyExc_NotImplementedError,
23786 : "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
23787 0 : __Pyx_DECREF_TypeName(o_type_name);
23788 0 : return -1;
23789 : }
23790 : }
23791 :
23792 0 : static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
23793 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
23794 : }
23795 :
23796 426 : static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
23797 426 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
23798 : }
23799 :
23800 0 : static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
23801 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
23802 : }
23803 :
23804 0 : static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
23805 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
23806 : }
23807 :
23808 0 : static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
23809 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
23810 : }
23811 :
23812 0 : static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
23813 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
23814 : }
23815 :
23816 0 : static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
23817 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
23818 : }
23819 :
23820 0 : static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
23821 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
23822 : }
23823 :
23824 0 : static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
23825 0 : return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
23826 : }
23827 :
23828 0 : static PyObject *__pyx_specialmethod___pyx_memoryview___repr__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
23829 0 : return __pyx_memoryview___repr__(self);
23830 : }
23831 :
23832 : static PyMethodDef __pyx_methods_memoryview[] = {
23833 : {"__repr__", (PyCFunction)__pyx_specialmethod___pyx_memoryview___repr__, METH_NOARGS|METH_COEXIST, 0},
23834 : {"is_c_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_c_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23835 : {"is_f_contig", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_is_f_contig, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23836 : {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23837 : {"copy_fortran", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_memoryview_copy_fortran, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23838 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23839 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryview_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
23840 : {0, 0, 0, 0}
23841 : };
23842 :
23843 : static struct PyGetSetDef __pyx_getsets_memoryview[] = {
23844 : {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
23845 : {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
23846 : {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
23847 : {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
23848 : {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
23849 : {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
23850 : {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
23851 : {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
23852 : {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
23853 : {0, 0, 0, 0, 0}
23854 : };
23855 : #if CYTHON_USE_TYPE_SPECS
23856 : #if !CYTHON_COMPILING_IN_LIMITED_API
23857 :
23858 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
23859 : #if PY_MAJOR_VERSION < 3
23860 : 0, /*bf_getreadbuffer*/
23861 : #endif
23862 : #if PY_MAJOR_VERSION < 3
23863 : 0, /*bf_getwritebuffer*/
23864 : #endif
23865 : #if PY_MAJOR_VERSION < 3
23866 : 0, /*bf_getsegcount*/
23867 : #endif
23868 : #if PY_MAJOR_VERSION < 3
23869 : 0, /*bf_getcharbuffer*/
23870 : #endif
23871 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
23872 : 0, /*bf_releasebuffer*/
23873 : };
23874 : #endif
23875 : static PyType_Slot __pyx_type___pyx_memoryview_slots[] = {
23876 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc_memoryview},
23877 : {Py_tp_repr, (void *)__pyx_memoryview___repr__},
23878 : {Py_sq_length, (void *)__pyx_memoryview___len__},
23879 : {Py_sq_item, (void *)__pyx_sq_item_memoryview},
23880 : {Py_mp_length, (void *)__pyx_memoryview___len__},
23881 : {Py_mp_subscript, (void *)__pyx_memoryview___getitem__},
23882 : {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_memoryview},
23883 : {Py_tp_str, (void *)__pyx_memoryview___str__},
23884 : #if defined(Py_bf_getbuffer)
23885 : {Py_bf_getbuffer, (void *)__pyx_memoryview_getbuffer},
23886 : #endif
23887 : {Py_tp_traverse, (void *)__pyx_tp_traverse_memoryview},
23888 : {Py_tp_clear, (void *)__pyx_tp_clear_memoryview},
23889 : {Py_tp_methods, (void *)__pyx_methods_memoryview},
23890 : {Py_tp_getset, (void *)__pyx_getsets_memoryview},
23891 : {Py_tp_new, (void *)__pyx_tp_new_memoryview},
23892 : {0, 0},
23893 : };
23894 : static PyType_Spec __pyx_type___pyx_memoryview_spec = {
23895 : "scipy.signal._peak_finding_utils.memoryview",
23896 : sizeof(struct __pyx_memoryview_obj),
23897 : 0,
23898 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
23899 : __pyx_type___pyx_memoryview_slots,
23900 : };
23901 : #else
23902 :
23903 : static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
23904 : __pyx_memoryview___len__, /*sq_length*/
23905 : 0, /*sq_concat*/
23906 : 0, /*sq_repeat*/
23907 : __pyx_sq_item_memoryview, /*sq_item*/
23908 : 0, /*sq_slice*/
23909 : 0, /*sq_ass_item*/
23910 : 0, /*sq_ass_slice*/
23911 : 0, /*sq_contains*/
23912 : 0, /*sq_inplace_concat*/
23913 : 0, /*sq_inplace_repeat*/
23914 : };
23915 :
23916 : static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
23917 : __pyx_memoryview___len__, /*mp_length*/
23918 : __pyx_memoryview___getitem__, /*mp_subscript*/
23919 : __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
23920 : };
23921 :
23922 : static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
23923 : #if PY_MAJOR_VERSION < 3
23924 : 0, /*bf_getreadbuffer*/
23925 : #endif
23926 : #if PY_MAJOR_VERSION < 3
23927 : 0, /*bf_getwritebuffer*/
23928 : #endif
23929 : #if PY_MAJOR_VERSION < 3
23930 : 0, /*bf_getsegcount*/
23931 : #endif
23932 : #if PY_MAJOR_VERSION < 3
23933 : 0, /*bf_getcharbuffer*/
23934 : #endif
23935 : __pyx_memoryview_getbuffer, /*bf_getbuffer*/
23936 : 0, /*bf_releasebuffer*/
23937 : };
23938 :
23939 : static PyTypeObject __pyx_type___pyx_memoryview = {
23940 : PyVarObject_HEAD_INIT(0, 0)
23941 : "scipy.signal._peak_finding_utils.""memoryview", /*tp_name*/
23942 : sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
23943 : 0, /*tp_itemsize*/
23944 : __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
23945 : #if PY_VERSION_HEX < 0x030800b4
23946 : 0, /*tp_print*/
23947 : #endif
23948 : #if PY_VERSION_HEX >= 0x030800b4
23949 : 0, /*tp_vectorcall_offset*/
23950 : #endif
23951 : 0, /*tp_getattr*/
23952 : 0, /*tp_setattr*/
23953 : #if PY_MAJOR_VERSION < 3
23954 : 0, /*tp_compare*/
23955 : #endif
23956 : #if PY_MAJOR_VERSION >= 3
23957 : 0, /*tp_as_async*/
23958 : #endif
23959 : __pyx_memoryview___repr__, /*tp_repr*/
23960 : 0, /*tp_as_number*/
23961 : &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
23962 : &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
23963 : 0, /*tp_hash*/
23964 : 0, /*tp_call*/
23965 : __pyx_memoryview___str__, /*tp_str*/
23966 : 0, /*tp_getattro*/
23967 : 0, /*tp_setattro*/
23968 : &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
23969 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
23970 : 0, /*tp_doc*/
23971 : __pyx_tp_traverse_memoryview, /*tp_traverse*/
23972 : __pyx_tp_clear_memoryview, /*tp_clear*/
23973 : 0, /*tp_richcompare*/
23974 : 0, /*tp_weaklistoffset*/
23975 : 0, /*tp_iter*/
23976 : 0, /*tp_iternext*/
23977 : __pyx_methods_memoryview, /*tp_methods*/
23978 : 0, /*tp_members*/
23979 : __pyx_getsets_memoryview, /*tp_getset*/
23980 : 0, /*tp_base*/
23981 : 0, /*tp_dict*/
23982 : 0, /*tp_descr_get*/
23983 : 0, /*tp_descr_set*/
23984 : #if !CYTHON_USE_TYPE_SPECS
23985 : 0, /*tp_dictoffset*/
23986 : #endif
23987 : 0, /*tp_init*/
23988 : 0, /*tp_alloc*/
23989 : __pyx_tp_new_memoryview, /*tp_new*/
23990 : 0, /*tp_free*/
23991 : 0, /*tp_is_gc*/
23992 : 0, /*tp_bases*/
23993 : 0, /*tp_mro*/
23994 : 0, /*tp_cache*/
23995 : 0, /*tp_subclasses*/
23996 : 0, /*tp_weaklist*/
23997 : 0, /*tp_del*/
23998 : 0, /*tp_version_tag*/
23999 : #if PY_VERSION_HEX >= 0x030400a1
24000 : #if CYTHON_USE_TP_FINALIZE
24001 : 0, /*tp_finalize*/
24002 : #else
24003 : NULL, /*tp_finalize*/
24004 : #endif
24005 : #endif
24006 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24007 : 0, /*tp_vectorcall*/
24008 : #endif
24009 : #if __PYX_NEED_TP_PRINT_SLOT == 1
24010 : 0, /*tp_print*/
24011 : #endif
24012 : #if PY_VERSION_HEX >= 0x030C0000
24013 : 0, /*tp_watched*/
24014 : #endif
24015 : #if PY_VERSION_HEX >= 0x030d00A4
24016 : 0, /*tp_versions_used*/
24017 : #endif
24018 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24019 : 0, /*tp_pypy_flags*/
24020 : #endif
24021 : };
24022 : #endif
24023 : static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
24024 :
24025 430 : static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
24026 430 : struct __pyx_memoryviewslice_obj *p;
24027 430 : PyObject *o = __pyx_tp_new_memoryview(t, a, k);
24028 430 : if (unlikely(!o)) return 0;
24029 430 : p = ((struct __pyx_memoryviewslice_obj *)o);
24030 430 : p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
24031 430 : p->from_object = Py_None; Py_INCREF(Py_None);
24032 430 : p->from_slice.memview = NULL;
24033 430 : return o;
24034 : }
24035 :
24036 430 : static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
24037 430 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
24038 : #if CYTHON_USE_TP_FINALIZE
24039 430 : if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
24040 0 : if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc__memoryviewslice) {
24041 0 : if (PyObject_CallFinalizerFromDealloc(o)) return;
24042 : }
24043 : }
24044 : #endif
24045 430 : PyObject_GC_UnTrack(o);
24046 : {
24047 430 : PyObject *etype, *eval, *etb;
24048 430 : PyErr_Fetch(&etype, &eval, &etb);
24049 430 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
24050 430 : __pyx_memoryviewslice___dealloc__(o);
24051 430 : __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
24052 430 : PyErr_Restore(etype, eval, etb);
24053 : }
24054 430 : Py_CLEAR(p->from_object);
24055 430 : PyObject_GC_Track(o);
24056 430 : __pyx_tp_dealloc_memoryview(o);
24057 : }
24058 :
24059 0 : static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
24060 0 : int e;
24061 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
24062 0 : e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
24063 0 : if (p->from_object) {
24064 0 : e = (*v)(p->from_object, a); if (e) return e;
24065 : }
24066 : return 0;
24067 : }
24068 :
24069 0 : static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
24070 0 : PyObject* tmp;
24071 0 : struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
24072 0 : __pyx_tp_clear_memoryview(o);
24073 0 : tmp = ((PyObject*)p->from_object);
24074 0 : p->from_object = Py_None; Py_INCREF(Py_None);
24075 0 : Py_XDECREF(tmp);
24076 0 : __PYX_XCLEAR_MEMVIEW(&p->from_slice, 1);
24077 0 : return 0;
24078 : }
24079 :
24080 : static PyMethodDef __pyx_methods__memoryviewslice[] = {
24081 : {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
24082 : {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
24083 : {0, 0, 0, 0}
24084 : };
24085 : #if CYTHON_USE_TYPE_SPECS
24086 : static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = {
24087 : {Py_tp_dealloc, (void *)__pyx_tp_dealloc__memoryviewslice},
24088 : {Py_tp_doc, (void *)PyDoc_STR("Internal class for passing memoryview slices to Python")},
24089 : {Py_tp_traverse, (void *)__pyx_tp_traverse__memoryviewslice},
24090 : {Py_tp_clear, (void *)__pyx_tp_clear__memoryviewslice},
24091 : {Py_tp_methods, (void *)__pyx_methods__memoryviewslice},
24092 : {Py_tp_new, (void *)__pyx_tp_new__memoryviewslice},
24093 : {0, 0},
24094 : };
24095 : static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = {
24096 : "scipy.signal._peak_finding_utils._memoryviewslice",
24097 : sizeof(struct __pyx_memoryviewslice_obj),
24098 : 0,
24099 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE,
24100 : __pyx_type___pyx_memoryviewslice_slots,
24101 : };
24102 : #else
24103 :
24104 : static PyTypeObject __pyx_type___pyx_memoryviewslice = {
24105 : PyVarObject_HEAD_INIT(0, 0)
24106 : "scipy.signal._peak_finding_utils.""_memoryviewslice", /*tp_name*/
24107 : sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
24108 : 0, /*tp_itemsize*/
24109 : __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
24110 : #if PY_VERSION_HEX < 0x030800b4
24111 : 0, /*tp_print*/
24112 : #endif
24113 : #if PY_VERSION_HEX >= 0x030800b4
24114 : 0, /*tp_vectorcall_offset*/
24115 : #endif
24116 : 0, /*tp_getattr*/
24117 : 0, /*tp_setattr*/
24118 : #if PY_MAJOR_VERSION < 3
24119 : 0, /*tp_compare*/
24120 : #endif
24121 : #if PY_MAJOR_VERSION >= 3
24122 : 0, /*tp_as_async*/
24123 : #endif
24124 : #if CYTHON_COMPILING_IN_PYPY || 0
24125 : __pyx_memoryview___repr__, /*tp_repr*/
24126 : #else
24127 : 0, /*tp_repr*/
24128 : #endif
24129 : 0, /*tp_as_number*/
24130 : 0, /*tp_as_sequence*/
24131 : 0, /*tp_as_mapping*/
24132 : 0, /*tp_hash*/
24133 : 0, /*tp_call*/
24134 : #if CYTHON_COMPILING_IN_PYPY || 0
24135 : __pyx_memoryview___str__, /*tp_str*/
24136 : #else
24137 : 0, /*tp_str*/
24138 : #endif
24139 : 0, /*tp_getattro*/
24140 : 0, /*tp_setattro*/
24141 : 0, /*tp_as_buffer*/
24142 : Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, /*tp_flags*/
24143 : PyDoc_STR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
24144 : __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
24145 : __pyx_tp_clear__memoryviewslice, /*tp_clear*/
24146 : 0, /*tp_richcompare*/
24147 : 0, /*tp_weaklistoffset*/
24148 : 0, /*tp_iter*/
24149 : 0, /*tp_iternext*/
24150 : __pyx_methods__memoryviewslice, /*tp_methods*/
24151 : 0, /*tp_members*/
24152 : 0, /*tp_getset*/
24153 : 0, /*tp_base*/
24154 : 0, /*tp_dict*/
24155 : 0, /*tp_descr_get*/
24156 : 0, /*tp_descr_set*/
24157 : #if !CYTHON_USE_TYPE_SPECS
24158 : 0, /*tp_dictoffset*/
24159 : #endif
24160 : 0, /*tp_init*/
24161 : 0, /*tp_alloc*/
24162 : __pyx_tp_new__memoryviewslice, /*tp_new*/
24163 : 0, /*tp_free*/
24164 : 0, /*tp_is_gc*/
24165 : 0, /*tp_bases*/
24166 : 0, /*tp_mro*/
24167 : 0, /*tp_cache*/
24168 : 0, /*tp_subclasses*/
24169 : 0, /*tp_weaklist*/
24170 : 0, /*tp_del*/
24171 : 0, /*tp_version_tag*/
24172 : #if PY_VERSION_HEX >= 0x030400a1
24173 : #if CYTHON_USE_TP_FINALIZE
24174 : 0, /*tp_finalize*/
24175 : #else
24176 : NULL, /*tp_finalize*/
24177 : #endif
24178 : #endif
24179 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
24180 : 0, /*tp_vectorcall*/
24181 : #endif
24182 : #if __PYX_NEED_TP_PRINT_SLOT == 1
24183 : 0, /*tp_print*/
24184 : #endif
24185 : #if PY_VERSION_HEX >= 0x030C0000
24186 : 0, /*tp_watched*/
24187 : #endif
24188 : #if PY_VERSION_HEX >= 0x030d00A4
24189 : 0, /*tp_versions_used*/
24190 : #endif
24191 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
24192 : 0, /*tp_pypy_flags*/
24193 : #endif
24194 : };
24195 : #endif
24196 :
24197 : static PyMethodDef __pyx_methods[] = {
24198 : {0, 0, 0, 0}
24199 : };
24200 : #ifndef CYTHON_SMALL_CODE
24201 : #if defined(__clang__)
24202 : #define CYTHON_SMALL_CODE
24203 : #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
24204 : #define CYTHON_SMALL_CODE __attribute__((cold))
24205 : #else
24206 : #define CYTHON_SMALL_CODE
24207 : #endif
24208 : #endif
24209 : /* #### Code section: pystring_table ### */
24210 :
24211 3 : static int __Pyx_CreateStringTabAndInitStrings(void) {
24212 3 : __Pyx_StringTabEntry __pyx_string_tab[] = {
24213 3 : {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
24214 3 : {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
24215 3 : {&__pyx_kp_s_All_dimensions_preceding_dimensi, __pyx_k_All_dimensions_preceding_dimensi, sizeof(__pyx_k_All_dimensions_preceding_dimensi), 0, 0, 1, 0},
24216 3 : {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
24217 3 : {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
24218 3 : {&__pyx_kp_s_Calculated_property_of_a_peak_ha, __pyx_k_Calculated_property_of_a_peak_ha, sizeof(__pyx_k_Calculated_property_of_a_peak_ha), 0, 0, 1, 0},
24219 3 : {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
24220 3 : {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
24221 3 : {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
24222 3 : {&__pyx_kp_u_Cannot_index_with_type, __pyx_k_Cannot_index_with_type, sizeof(__pyx_k_Cannot_index_with_type), 0, 1, 0, 0},
24223 3 : {&__pyx_kp_s_Cannot_transpose_memoryview_with, __pyx_k_Cannot_transpose_memoryview_with, sizeof(__pyx_k_Cannot_transpose_memoryview_with), 0, 0, 1, 0},
24224 3 : {&__pyx_kp_s_Dimension_d_is_not_direct, __pyx_k_Dimension_d_is_not_direct, sizeof(__pyx_k_Dimension_d_is_not_direct), 0, 0, 1, 0},
24225 3 : {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
24226 3 : {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
24227 3 : {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
24228 3 : {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
24229 3 : {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
24230 3 : {&__pyx_kp_s_Index_out_of_bounds_axis_d, __pyx_k_Index_out_of_bounds_axis_d, sizeof(__pyx_k_Index_out_of_bounds_axis_d), 0, 0, 1, 0},
24231 3 : {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
24232 3 : {&__pyx_kp_u_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 1, 0, 0},
24233 3 : {&__pyx_kp_u_Invalid_shape_in_axis, __pyx_k_Invalid_shape_in_axis, sizeof(__pyx_k_Invalid_shape_in_axis), 0, 1, 0, 0},
24234 3 : {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
24235 3 : {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
24236 3 : {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
24237 3 : {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
24238 3 : {&__pyx_kp_u_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 1, 0, 0},
24239 3 : {&__pyx_n_s_PeakPropertyWarning, __pyx_k_PeakPropertyWarning, sizeof(__pyx_k_PeakPropertyWarning), 0, 0, 1, 1},
24240 3 : {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
24241 3 : {&__pyx_n_s_RuntimeWarning, __pyx_k_RuntimeWarning, sizeof(__pyx_k_RuntimeWarning), 0, 0, 1, 1},
24242 3 : {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
24243 3 : {&__pyx_kp_s_Step_may_not_be_zero_axis_d, __pyx_k_Step_may_not_be_zero_axis_d, sizeof(__pyx_k_Step_may_not_be_zero_axis_d), 0, 0, 1, 0},
24244 3 : {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
24245 3 : {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
24246 3 : {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
24247 3 : {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
24248 3 : {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
24249 3 : {&__pyx_n_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 1},
24250 3 : {&__pyx_n_s__34, __pyx_k__34, sizeof(__pyx_k__34), 0, 0, 1, 1},
24251 3 : {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
24252 3 : {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
24253 3 : {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
24254 3 : {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
24255 3 : {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
24256 3 : {&__pyx_kp_u_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 1, 0, 0},
24257 3 : {&__pyx_n_s_argsort, __pyx_k_argsort, sizeof(__pyx_k_argsort), 0, 0, 1, 1},
24258 3 : {&__pyx_kp_u_arrays_in_prominence_data_must_h, __pyx_k_arrays_in_prominence_data_must_h, sizeof(__pyx_k_arrays_in_prominence_data_must_h), 0, 1, 0, 0},
24259 3 : {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
24260 3 : {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
24261 3 : {&__pyx_n_s_bool, __pyx_k_bool, sizeof(__pyx_k_bool), 0, 0, 1, 1},
24262 3 : {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
24263 3 : {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
24264 3 : {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
24265 3 : {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
24266 3 : {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
24267 3 : {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
24268 3 : {&__pyx_kp_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 0},
24269 3 : {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
24270 3 : {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
24271 3 : {&__pyx_n_s_count, __pyx_k_count, sizeof(__pyx_k_count), 0, 0, 1, 1},
24272 3 : {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
24273 3 : {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
24274 3 : {&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
24275 3 : {&__pyx_n_s_distance_2, __pyx_k_distance_2, sizeof(__pyx_k_distance_2), 0, 0, 1, 1},
24276 3 : {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
24277 3 : {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
24278 3 : {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
24279 3 : {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
24280 3 : {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
24281 3 : {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
24282 3 : {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
24283 3 : {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
24284 3 : {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
24285 3 : {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
24286 3 : {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
24287 3 : {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
24288 3 : {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
24289 3 : {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
24290 3 : {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
24291 3 : {&__pyx_kp_u_got, __pyx_k_got, sizeof(__pyx_k_got), 0, 1, 0, 0},
24292 3 : {&__pyx_kp_u_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 1, 0, 0},
24293 3 : {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
24294 3 : {&__pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_k_home_czgdp18079_Quansight_scipy, sizeof(__pyx_k_home_czgdp18079_Quansight_scipy), 0, 0, 1, 0},
24295 3 : {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
24296 3 : {&__pyx_n_s_i_ahead, __pyx_k_i_ahead, sizeof(__pyx_k_i_ahead), 0, 0, 1, 1},
24297 3 : {&__pyx_n_s_i_max, __pyx_k_i_max, sizeof(__pyx_k_i_max), 0, 0, 1, 1},
24298 3 : {&__pyx_n_s_i_min, __pyx_k_i_min, sizeof(__pyx_k_i_min), 0, 0, 1, 1},
24299 3 : {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
24300 3 : {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
24301 3 : {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
24302 3 : {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
24303 3 : {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
24304 3 : {&__pyx_n_s_intp, __pyx_k_intp, sizeof(__pyx_k_intp), 0, 0, 1, 1},
24305 3 : {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
24306 3 : {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
24307 3 : {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
24308 3 : {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
24309 3 : {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
24310 3 : {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
24311 3 : {&__pyx_n_s_keep, __pyx_k_keep, sizeof(__pyx_k_keep), 0, 0, 1, 1},
24312 3 : {&__pyx_n_s_left_bases, __pyx_k_left_bases, sizeof(__pyx_k_left_bases), 0, 0, 1, 1},
24313 3 : {&__pyx_n_s_left_edges, __pyx_k_left_edges, sizeof(__pyx_k_left_edges), 0, 0, 1, 1},
24314 3 : {&__pyx_n_s_left_ip, __pyx_k_left_ip, sizeof(__pyx_k_left_ip), 0, 0, 1, 1},
24315 3 : {&__pyx_n_s_left_ips, __pyx_k_left_ips, sizeof(__pyx_k_left_ips), 0, 0, 1, 1},
24316 3 : {&__pyx_n_s_left_min, __pyx_k_left_min, sizeof(__pyx_k_left_min), 0, 0, 1, 1},
24317 3 : {&__pyx_n_s_local_maxima_1d, __pyx_k_local_maxima_1d, sizeof(__pyx_k_local_maxima_1d), 0, 0, 1, 1},
24318 3 : {&__pyx_n_u_local_maxima_1d, __pyx_k_local_maxima_1d, sizeof(__pyx_k_local_maxima_1d), 0, 1, 0, 1},
24319 3 : {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
24320 3 : {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
24321 3 : {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
24322 3 : {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
24323 3 : {&__pyx_n_s_midpoints, __pyx_k_midpoints, sizeof(__pyx_k_midpoints), 0, 0, 1, 1},
24324 3 : {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
24325 3 : {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
24326 3 : {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
24327 3 : {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
24328 3 : {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
24329 3 : {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
24330 3 : {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
24331 3 : {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
24332 3 : {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
24333 3 : {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
24334 3 : {&__pyx_kp_u_numpy__core_multiarray_failed_to, __pyx_k_numpy__core_multiarray_failed_to, sizeof(__pyx_k_numpy__core_multiarray_failed_to), 0, 1, 0, 0},
24335 3 : {&__pyx_kp_u_numpy__core_umath_failed_to_impo, __pyx_k_numpy__core_umath_failed_to_impo, sizeof(__pyx_k_numpy__core_umath_failed_to_impo), 0, 1, 0, 0},
24336 3 : {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
24337 3 : {&__pyx_n_s_ones, __pyx_k_ones, sizeof(__pyx_k_ones), 0, 0, 1, 1},
24338 3 : {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
24339 3 : {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
24340 3 : {&__pyx_n_s_peak, __pyx_k_peak, sizeof(__pyx_k_peak), 0, 0, 1, 1},
24341 3 : {&__pyx_kp_u_peak_is_not_a_valid_index_for_x, __pyx_k_peak_is_not_a_valid_index_for_x, sizeof(__pyx_k_peak_is_not_a_valid_index_for_x), 0, 1, 0, 0},
24342 3 : {&__pyx_n_s_peak_nr, __pyx_k_peak_nr, sizeof(__pyx_k_peak_nr), 0, 0, 1, 1},
24343 3 : {&__pyx_n_s_peak_prominences, __pyx_k_peak_prominences, sizeof(__pyx_k_peak_prominences), 0, 0, 1, 1},
24344 3 : {&__pyx_n_u_peak_prominences, __pyx_k_peak_prominences, sizeof(__pyx_k_peak_prominences), 0, 1, 0, 1},
24345 3 : {&__pyx_n_s_peak_widths, __pyx_k_peak_widths, sizeof(__pyx_k_peak_widths), 0, 0, 1, 1},
24346 3 : {&__pyx_n_u_peak_widths, __pyx_k_peak_widths, sizeof(__pyx_k_peak_widths), 0, 1, 0, 1},
24347 3 : {&__pyx_n_s_peaks, __pyx_k_peaks, sizeof(__pyx_k_peaks), 0, 0, 1, 1},
24348 3 : {&__pyx_n_s_peaks_size, __pyx_k_peaks_size, sizeof(__pyx_k_peaks_size), 0, 0, 1, 1},
24349 3 : {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
24350 3 : {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
24351 3 : {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1},
24352 3 : {&__pyx_n_s_priority_to_position, __pyx_k_priority_to_position, sizeof(__pyx_k_priority_to_position), 0, 0, 1, 1},
24353 3 : {&__pyx_kp_u_prominence_data_is_invalid_for_p, __pyx_k_prominence_data_is_invalid_for_p, sizeof(__pyx_k_prominence_data_is_invalid_for_p), 0, 1, 0, 0},
24354 3 : {&__pyx_n_s_prominences, __pyx_k_prominences, sizeof(__pyx_k_prominences), 0, 0, 1, 1},
24355 3 : {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
24356 3 : {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
24357 3 : {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
24358 3 : {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
24359 3 : {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
24360 3 : {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
24361 3 : {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
24362 3 : {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
24363 3 : {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
24364 3 : {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
24365 3 : {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
24366 3 : {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
24367 3 : {&__pyx_n_s_refcheck, __pyx_k_refcheck, sizeof(__pyx_k_refcheck), 0, 0, 1, 1},
24368 3 : {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
24369 3 : {&__pyx_n_s_rel_height, __pyx_k_rel_height, sizeof(__pyx_k_rel_height), 0, 0, 1, 1},
24370 3 : {&__pyx_kp_u_rel_height_must_be_greater_or_e, __pyx_k_rel_height_must_be_greater_or_e, sizeof(__pyx_k_rel_height_must_be_greater_or_e), 0, 1, 0, 0},
24371 3 : {&__pyx_n_s_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 0, 0, 1, 1},
24372 3 : {&__pyx_n_s_right_bases, __pyx_k_right_bases, sizeof(__pyx_k_right_bases), 0, 0, 1, 1},
24373 3 : {&__pyx_n_s_right_edges, __pyx_k_right_edges, sizeof(__pyx_k_right_edges), 0, 0, 1, 1},
24374 3 : {&__pyx_n_s_right_ip, __pyx_k_right_ip, sizeof(__pyx_k_right_ip), 0, 0, 1, 1},
24375 3 : {&__pyx_n_s_right_ips, __pyx_k_right_ips, sizeof(__pyx_k_right_ips), 0, 0, 1, 1},
24376 3 : {&__pyx_n_s_right_min, __pyx_k_right_min, sizeof(__pyx_k_right_min), 0, 0, 1, 1},
24377 3 : {&__pyx_n_s_scipy_signal__peak_finding_utils, __pyx_k_scipy_signal__peak_finding_utils, sizeof(__pyx_k_scipy_signal__peak_finding_utils), 0, 0, 1, 1},
24378 3 : {&__pyx_n_s_select_by_peak_distance, __pyx_k_select_by_peak_distance, sizeof(__pyx_k_select_by_peak_distance), 0, 0, 1, 1},
24379 3 : {&__pyx_n_u_select_by_peak_distance, __pyx_k_select_by_peak_distance, sizeof(__pyx_k_select_by_peak_distance), 0, 1, 0, 1},
24380 3 : {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
24381 3 : {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
24382 3 : {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
24383 3 : {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
24384 3 : {&__pyx_n_s_show_warning, __pyx_k_show_warning, sizeof(__pyx_k_show_warning), 0, 0, 1, 1},
24385 3 : {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
24386 3 : {&__pyx_kp_u_some_peaks_have_a_prominence_of, __pyx_k_some_peaks_have_a_prominence_of, sizeof(__pyx_k_some_peaks_have_a_prominence_of), 0, 1, 0, 0},
24387 3 : {&__pyx_kp_u_some_peaks_have_a_width_of_0, __pyx_k_some_peaks_have_a_width_of_0, sizeof(__pyx_k_some_peaks_have_a_width_of_0), 0, 1, 0, 0},
24388 3 : {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
24389 3 : {&__pyx_n_s_stacklevel, __pyx_k_stacklevel, sizeof(__pyx_k_stacklevel), 0, 0, 1, 1},
24390 3 : {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
24391 3 : {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
24392 3 : {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
24393 3 : {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
24394 3 : {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
24395 3 : {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
24396 3 : {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
24397 3 : {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
24398 3 : {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
24399 3 : {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
24400 3 : {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
24401 3 : {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
24402 3 : {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
24403 3 : {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
24404 3 : {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
24405 3 : {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
24406 3 : {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
24407 3 : {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
24408 3 : {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
24409 3 : {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
24410 3 : {&__pyx_n_s_width_heights, __pyx_k_width_heights, sizeof(__pyx_k_width_heights), 0, 0, 1, 1},
24411 3 : {&__pyx_n_s_widths, __pyx_k_widths, sizeof(__pyx_k_widths), 0, 0, 1, 1},
24412 3 : {&__pyx_n_s_wlen, __pyx_k_wlen, sizeof(__pyx_k_wlen), 0, 0, 1, 1},
24413 3 : {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
24414 : {0, 0, 0, 0, 0, 0, 0}
24415 : };
24416 3 : return __Pyx_InitStrings(__pyx_string_tab);
24417 : }
24418 : /* #### Code section: cached_builtins ### */
24419 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
24420 3 : __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 161, __pyx_L1_error)
24421 3 : __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 138, __pyx_L1_error)
24422 3 : __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 225, __pyx_L1_error)
24423 3 : __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(1, 100, __pyx_L1_error)
24424 3 : __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 156, __pyx_L1_error)
24425 3 : __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 159, __pyx_L1_error)
24426 3 : __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
24427 3 : __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(1, 373, __pyx_L1_error)
24428 3 : __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 408, __pyx_L1_error)
24429 3 : __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 618, __pyx_L1_error)
24430 3 : __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 914, __pyx_L1_error)
24431 3 : __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1025, __pyx_L1_error)
24432 : return 0;
24433 : __pyx_L1_error:;
24434 : return -1;
24435 : }
24436 : /* #### Code section: cached_constants ### */
24437 :
24438 3 : static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
24439 : __Pyx_RefNannyDeclarations
24440 3 : __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
24441 :
24442 : /* "View.MemoryView":582
24443 : * def suboffsets(self):
24444 : * if self.view.suboffsets == NULL:
24445 : * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
24446 : *
24447 : * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
24448 : */
24449 3 : __pyx_tuple__4 = PyTuple_New(1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 582, __pyx_L1_error)
24450 3 : __Pyx_GOTREF(__pyx_tuple__4);
24451 3 : __Pyx_INCREF(__pyx_int_neg_1);
24452 3 : __Pyx_GIVEREF(__pyx_int_neg_1);
24453 3 : if (__Pyx_PyTuple_SET_ITEM(__pyx_tuple__4, 0, __pyx_int_neg_1)) __PYX_ERR(1, 582, __pyx_L1_error);
24454 3 : __Pyx_GIVEREF(__pyx_tuple__4);
24455 :
24456 : /* "View.MemoryView":679
24457 : * tup = <tuple>index if isinstance(index, tuple) else (index,)
24458 : *
24459 : * result = [slice(None)] * ndim # <<<<<<<<<<<<<<
24460 : * have_slices = False
24461 : * seen_ellipsis = False
24462 : */
24463 3 : __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(1, 679, __pyx_L1_error)
24464 3 : __Pyx_GOTREF(__pyx_slice__5);
24465 3 : __Pyx_GIVEREF(__pyx_slice__5);
24466 :
24467 : /* "(tree fragment)":4
24468 : * cdef object __pyx_PickleError
24469 : * cdef object __pyx_result
24470 : * if __pyx_checksum not in (0x82a3537, 0x6ae9995, 0xb068931): # <<<<<<<<<<<<<<
24471 : * from pickle import PickleError as __pyx_PickleError
24472 : * raise __pyx_PickleError, "Incompatible checksums (0x%x vs (0x82a3537, 0x6ae9995, 0xb068931) = (name))" % __pyx_checksum
24473 : */
24474 3 : __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_136983863, __pyx_int_112105877, __pyx_int_184977713); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 4, __pyx_L1_error)
24475 3 : __Pyx_GOTREF(__pyx_tuple__8);
24476 3 : __Pyx_GIVEREF(__pyx_tuple__8);
24477 :
24478 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1025
24479 : * __pyx_import_array()
24480 : * except Exception:
24481 : * raise ImportError("numpy._core.multiarray failed to import") # <<<<<<<<<<<<<<
24482 : *
24483 : * cdef inline int import_umath() except -1:
24484 : */
24485 3 : __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(2, 1025, __pyx_L1_error)
24486 3 : __Pyx_GOTREF(__pyx_tuple__9);
24487 3 : __Pyx_GIVEREF(__pyx_tuple__9);
24488 :
24489 : /* "../../../miniforge3/envs/scipy-dev/lib/python3.12/site-packages/numpy/__init__.cython-30.pxd":1031
24490 : * _import_umath()
24491 : * except Exception:
24492 : * raise ImportError("numpy._core.umath failed to import") # <<<<<<<<<<<<<<
24493 : *
24494 : * cdef inline int import_ufunc() except -1:
24495 : */
24496 3 : __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_numpy__core_umath_failed_to_impo); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(2, 1031, __pyx_L1_error)
24497 3 : __Pyx_GOTREF(__pyx_tuple__10);
24498 3 : __Pyx_GIVEREF(__pyx_tuple__10);
24499 :
24500 : /* "scipy/signal/_peak_finding_utils.pyx":324
24501 : *
24502 : * if rel_height < 0:
24503 : * raise ValueError('`rel_height` must be greater or equal to 0.0') # <<<<<<<<<<<<<<
24504 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0]
24505 : * == right_bases.shape[0]):
24506 : */
24507 3 : __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_rel_height_must_be_greater_or_e); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 324, __pyx_L1_error)
24508 3 : __Pyx_GOTREF(__pyx_tuple__11);
24509 3 : __Pyx_GIVEREF(__pyx_tuple__11);
24510 :
24511 : /* "scipy/signal/_peak_finding_utils.pyx":327
24512 : * if not (peaks.shape[0] == prominences.shape[0] == left_bases.shape[0]
24513 : * == right_bases.shape[0]):
24514 : * raise ValueError("arrays in `prominence_data` must have the same shape " # <<<<<<<<<<<<<<
24515 : * "as `peaks`")
24516 : *
24517 : */
24518 3 : __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_arrays_in_prominence_data_must_h); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 327, __pyx_L1_error)
24519 3 : __Pyx_GOTREF(__pyx_tuple__12);
24520 3 : __Pyx_GIVEREF(__pyx_tuple__12);
24521 :
24522 : /* "View.MemoryView":100
24523 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
24524 : * try:
24525 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
24526 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
24527 : * else:
24528 : */
24529 3 : __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 100, __pyx_L1_error)
24530 3 : __Pyx_GOTREF(__pyx_tuple__13);
24531 3 : __Pyx_GIVEREF(__pyx_tuple__13);
24532 3 : __pyx_tuple__14 = PyTuple_Pack(2, __pyx_int_3, __pyx_int_3); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 100, __pyx_L1_error)
24533 3 : __Pyx_GOTREF(__pyx_tuple__14);
24534 3 : __Pyx_GIVEREF(__pyx_tuple__14);
24535 :
24536 : /* "View.MemoryView":101
24537 : * try:
24538 : * if __import__("sys").version_info >= (3, 3):
24539 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
24540 : * else:
24541 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
24542 : */
24543 3 : __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_collections_abc); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 101, __pyx_L1_error)
24544 3 : __Pyx_GOTREF(__pyx_tuple__15);
24545 3 : __Pyx_GIVEREF(__pyx_tuple__15);
24546 :
24547 : /* "View.MemoryView":103
24548 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
24549 : * else:
24550 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
24551 : * except:
24552 : *
24553 : */
24554 3 : __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_collections); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 103, __pyx_L1_error)
24555 3 : __Pyx_GOTREF(__pyx_tuple__16);
24556 3 : __Pyx_GIVEREF(__pyx_tuple__16);
24557 :
24558 : /* "View.MemoryView":309
24559 : * return self.name
24560 : *
24561 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
24562 : * cdef strided = Enum("<strided and direct>") # default
24563 : * cdef indirect = Enum("<strided and indirect>")
24564 : */
24565 3 : __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 309, __pyx_L1_error)
24566 3 : __Pyx_GOTREF(__pyx_tuple__17);
24567 3 : __Pyx_GIVEREF(__pyx_tuple__17);
24568 :
24569 : /* "View.MemoryView":310
24570 : *
24571 : * cdef generic = Enum("<strided and direct or indirect>")
24572 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
24573 : * cdef indirect = Enum("<strided and indirect>")
24574 : *
24575 : */
24576 3 : __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 310, __pyx_L1_error)
24577 3 : __Pyx_GOTREF(__pyx_tuple__18);
24578 3 : __Pyx_GIVEREF(__pyx_tuple__18);
24579 :
24580 : /* "View.MemoryView":311
24581 : * cdef generic = Enum("<strided and direct or indirect>")
24582 : * cdef strided = Enum("<strided and direct>") # default
24583 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
24584 : *
24585 : *
24586 : */
24587 3 : __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 311, __pyx_L1_error)
24588 3 : __Pyx_GOTREF(__pyx_tuple__19);
24589 3 : __Pyx_GIVEREF(__pyx_tuple__19);
24590 :
24591 : /* "View.MemoryView":314
24592 : *
24593 : *
24594 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
24595 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
24596 : *
24597 : */
24598 3 : __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 314, __pyx_L1_error)
24599 3 : __Pyx_GOTREF(__pyx_tuple__20);
24600 3 : __Pyx_GIVEREF(__pyx_tuple__20);
24601 :
24602 : /* "View.MemoryView":315
24603 : *
24604 : * cdef contiguous = Enum("<contiguous and direct>")
24605 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
24606 : *
24607 : *
24608 : */
24609 3 : __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 315, __pyx_L1_error)
24610 3 : __Pyx_GOTREF(__pyx_tuple__21);
24611 3 : __Pyx_GIVEREF(__pyx_tuple__21);
24612 :
24613 : /* "(tree fragment)":1
24614 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
24615 : * cdef object __pyx_PickleError
24616 : * cdef object __pyx_result
24617 : */
24618 3 : __pyx_tuple__22 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 1, __pyx_L1_error)
24619 3 : __Pyx_GOTREF(__pyx_tuple__22);
24620 3 : __Pyx_GIVEREF(__pyx_tuple__22);
24621 3 : __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 1, __pyx_L1_error)
24622 :
24623 : /* "scipy/signal/_peak_finding_utils.pyx":20
24624 : *
24625 : *
24626 : * def _local_maxima_1d(const np.float64_t[::1] x not None): # <<<<<<<<<<<<<<
24627 : * """
24628 : * Find local maxima in a 1D array.
24629 : */
24630 3 : __pyx_tuple__24 = PyTuple_Pack(8, __pyx_n_s_x, __pyx_n_s_midpoints, __pyx_n_s_left_edges, __pyx_n_s_right_edges, __pyx_n_s_m, __pyx_n_s_i, __pyx_n_s_i_ahead, __pyx_n_s_i_max); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 20, __pyx_L1_error)
24631 3 : __Pyx_GOTREF(__pyx_tuple__24);
24632 3 : __Pyx_GIVEREF(__pyx_tuple__24);
24633 3 : __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_local_maxima_1d, 20, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 20, __pyx_L1_error)
24634 :
24635 : /* "scipy/signal/_peak_finding_utils.pyx":91
24636 : *
24637 : *
24638 : * def _select_by_peak_distance(const np.intp_t[::1] peaks not None, # <<<<<<<<<<<<<<
24639 : * const np.float64_t[::1] priority not None,
24640 : * np.float64_t distance):
24641 : */
24642 3 : __pyx_tuple__26 = PyTuple_Pack(10, __pyx_n_s_peaks, __pyx_n_s_priority, __pyx_n_s_distance, __pyx_n_s_keep, __pyx_n_s_priority_to_position, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_peaks_size, __pyx_n_s_distance_2); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 91, __pyx_L1_error)
24643 3 : __Pyx_GOTREF(__pyx_tuple__26);
24644 3 : __Pyx_GIVEREF(__pyx_tuple__26);
24645 3 : __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_select_by_peak_distance, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 91, __pyx_L1_error)
24646 :
24647 : /* "scipy/signal/_peak_finding_utils.pyx":161
24648 : *
24649 : *
24650 : * class PeakPropertyWarning(RuntimeWarning): # <<<<<<<<<<<<<<
24651 : * """Calculated property of a peak has unexpected value."""
24652 : * pass
24653 : */
24654 3 : __pyx_tuple__28 = PyTuple_Pack(1, __pyx_builtin_RuntimeWarning); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 161, __pyx_L1_error)
24655 3 : __Pyx_GOTREF(__pyx_tuple__28);
24656 3 : __Pyx_GIVEREF(__pyx_tuple__28);
24657 3 : __pyx_tuple__29 = PyTuple_Pack(1, __pyx_builtin_RuntimeWarning); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 161, __pyx_L1_error)
24658 3 : __Pyx_GOTREF(__pyx_tuple__29);
24659 3 : __Pyx_GIVEREF(__pyx_tuple__29);
24660 :
24661 : /* "scipy/signal/_peak_finding_utils.pyx":166
24662 : *
24663 : *
24664 : * def _peak_prominences(const np.float64_t[::1] x not None, # <<<<<<<<<<<<<<
24665 : * const np.intp_t[::1] peaks not None,
24666 : * np.intp_t wlen):
24667 : */
24668 3 : __pyx_tuple__30 = PyTuple_Pack(14, __pyx_n_s_x, __pyx_n_s_peaks, __pyx_n_s_wlen, __pyx_n_s_prominences, __pyx_n_s_left_bases, __pyx_n_s_right_bases, __pyx_n_s_left_min, __pyx_n_s_right_min, __pyx_n_s_peak_nr, __pyx_n_s_peak, __pyx_n_s_i_min, __pyx_n_s_i_max, __pyx_n_s_i, __pyx_n_s_show_warning); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 166, __pyx_L1_error)
24669 3 : __Pyx_GOTREF(__pyx_tuple__30);
24670 3 : __Pyx_GIVEREF(__pyx_tuple__30);
24671 3 : __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_peak_prominences, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 166, __pyx_L1_error)
24672 :
24673 : /* "scipy/signal/_peak_finding_utils.pyx":264
24674 : *
24675 : *
24676 : * def _peak_widths(const np.float64_t[::1] x not None, # <<<<<<<<<<<<<<
24677 : * const np.intp_t[::1] peaks not None,
24678 : * np.float64_t rel_height,
24679 : */
24680 3 : __pyx_tuple__32 = PyTuple_Pack(19, __pyx_n_s_x, __pyx_n_s_peaks, __pyx_n_s_rel_height, __pyx_n_s_prominences, __pyx_n_s_left_bases, __pyx_n_s_right_bases, __pyx_n_s_widths, __pyx_n_s_width_heights, __pyx_n_s_left_ips, __pyx_n_s_right_ips, __pyx_n_s_height, __pyx_n_s_left_ip, __pyx_n_s_right_ip, __pyx_n_s_p, __pyx_n_s_peak, __pyx_n_s_i, __pyx_n_s_i_max, __pyx_n_s_i_min, __pyx_n_s_show_warning); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 264, __pyx_L1_error)
24681 3 : __Pyx_GOTREF(__pyx_tuple__32);
24682 3 : __Pyx_GIVEREF(__pyx_tuple__32);
24683 3 : __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_czgdp18079_Quansight_scipy, __pyx_n_s_peak_widths, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 264, __pyx_L1_error)
24684 : __Pyx_RefNannyFinishContext();
24685 : return 0;
24686 : __pyx_L1_error:;
24687 : __Pyx_RefNannyFinishContext();
24688 : return -1;
24689 : }
24690 : /* #### Code section: init_constants ### */
24691 :
24692 3 : static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
24693 3 : if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
24694 3 : __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
24695 3 : __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24696 3 : __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
24697 3 : __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
24698 3 : __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(0, 1, __pyx_L1_error)
24699 3 : __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(0, 1, __pyx_L1_error)
24700 3 : __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
24701 3 : __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
24702 : return 0;
24703 : __pyx_L1_error:;
24704 : return -1;
24705 : }
24706 : /* #### Code section: init_globals ### */
24707 :
24708 3 : static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
24709 : /* AssertionsEnabled.init */
24710 3 : if (likely(__Pyx_init_assertions_enabled() == 0)); else
24711 :
24712 0 : if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
24713 :
24714 : return 0;
24715 0 : __pyx_L1_error:;
24716 0 : return -1;
24717 : }
24718 : /* #### Code section: init_module ### */
24719 :
24720 : static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
24721 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
24722 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
24723 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
24724 : static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
24725 : static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
24726 : static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
24727 :
24728 3 : static int __Pyx_modinit_global_init_code(void) {
24729 : __Pyx_RefNannyDeclarations
24730 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
24731 : /*--- Global init code ---*/
24732 3 : __pyx_collections_abc_Sequence = Py_None; Py_INCREF(Py_None);
24733 3 : generic = Py_None; Py_INCREF(Py_None);
24734 3 : strided = Py_None; Py_INCREF(Py_None);
24735 3 : indirect = Py_None; Py_INCREF(Py_None);
24736 3 : contiguous = Py_None; Py_INCREF(Py_None);
24737 3 : indirect_contiguous = Py_None; Py_INCREF(Py_None);
24738 3 : __Pyx_RefNannyFinishContext();
24739 3 : return 0;
24740 : }
24741 :
24742 : static int __Pyx_modinit_variable_export_code(void) {
24743 : __Pyx_RefNannyDeclarations
24744 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
24745 : /*--- Variable export code ---*/
24746 : __Pyx_RefNannyFinishContext();
24747 : return 0;
24748 : }
24749 :
24750 : static int __Pyx_modinit_function_export_code(void) {
24751 : __Pyx_RefNannyDeclarations
24752 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
24753 : /*--- Function export code ---*/
24754 : __Pyx_RefNannyFinishContext();
24755 : return 0;
24756 : }
24757 :
24758 3 : static int __Pyx_modinit_type_init_code(void) {
24759 : __Pyx_RefNannyDeclarations
24760 3 : PyObject *__pyx_t_1 = NULL;
24761 3 : int __pyx_lineno = 0;
24762 3 : const char *__pyx_filename = NULL;
24763 3 : int __pyx_clineno = 0;
24764 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
24765 : /*--- Type init code ---*/
24766 3 : __pyx_vtabptr_array = &__pyx_vtable_array;
24767 3 : __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
24768 : #if CYTHON_USE_TYPE_SPECS
24769 : __pyx_array_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_array_spec, NULL); if (unlikely(!__pyx_array_type)) __PYX_ERR(1, 114, __pyx_L1_error)
24770 : #if !CYTHON_COMPILING_IN_LIMITED_API
24771 : __pyx_array_type->tp_as_buffer = &__pyx_tp_as_buffer_array;
24772 : if (!__pyx_array_type->tp_as_buffer->bf_releasebuffer && __pyx_array_type->tp_base->tp_as_buffer && __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer) {
24773 : __pyx_array_type->tp_as_buffer->bf_releasebuffer = __pyx_array_type->tp_base->tp_as_buffer->bf_releasebuffer;
24774 : }
24775 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
24776 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
24777 : #elif defined(_MSC_VER)
24778 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
24779 : #else
24780 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
24781 : #endif
24782 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_array_spec, __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
24783 : #else
24784 3 : __pyx_array_type = &__pyx_type___pyx_array;
24785 : #endif
24786 : #if !CYTHON_COMPILING_IN_LIMITED_API
24787 : #endif
24788 : #if !CYTHON_USE_TYPE_SPECS
24789 3 : if (__Pyx_PyType_Ready(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
24790 : #endif
24791 : #if PY_MAJOR_VERSION < 3
24792 : __pyx_array_type->tp_print = 0;
24793 : #endif
24794 3 : if (__Pyx_SetVtable(__pyx_array_type, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
24795 : #if !CYTHON_COMPILING_IN_LIMITED_API
24796 3 : if (__Pyx_MergeVtables(__pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
24797 : #endif
24798 : #if !CYTHON_COMPILING_IN_LIMITED_API
24799 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_array_type) < 0) __PYX_ERR(1, 114, __pyx_L1_error)
24800 : #endif
24801 : #if CYTHON_USE_TYPE_SPECS
24802 : __pyx_MemviewEnum_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_MemviewEnum_spec, NULL); if (unlikely(!__pyx_MemviewEnum_type)) __PYX_ERR(1, 302, __pyx_L1_error)
24803 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_MemviewEnum_spec, __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
24804 : #else
24805 3 : __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
24806 : #endif
24807 : #if !CYTHON_COMPILING_IN_LIMITED_API
24808 : #endif
24809 : #if !CYTHON_USE_TYPE_SPECS
24810 3 : if (__Pyx_PyType_Ready(__pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
24811 : #endif
24812 : #if PY_MAJOR_VERSION < 3
24813 : __pyx_MemviewEnum_type->tp_print = 0;
24814 : #endif
24815 : #if !CYTHON_COMPILING_IN_LIMITED_API
24816 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_MemviewEnum_type->tp_dictoffset && __pyx_MemviewEnum_type->tp_getattro == PyObject_GenericGetAttr)) {
24817 3 : __pyx_MemviewEnum_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
24818 : }
24819 : #endif
24820 : #if !CYTHON_COMPILING_IN_LIMITED_API
24821 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_MemviewEnum_type) < 0) __PYX_ERR(1, 302, __pyx_L1_error)
24822 : #endif
24823 3 : __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
24824 3 : __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
24825 3 : __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
24826 3 : __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
24827 3 : __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
24828 3 : __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
24829 3 : __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
24830 3 : __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
24831 3 : __pyx_vtable_memoryview._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryview__get_base;
24832 : #if CYTHON_USE_TYPE_SPECS
24833 : __pyx_memoryview_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryview_spec, NULL); if (unlikely(!__pyx_memoryview_type)) __PYX_ERR(1, 337, __pyx_L1_error)
24834 : #if !CYTHON_COMPILING_IN_LIMITED_API
24835 : __pyx_memoryview_type->tp_as_buffer = &__pyx_tp_as_buffer_memoryview;
24836 : if (!__pyx_memoryview_type->tp_as_buffer->bf_releasebuffer && __pyx_memoryview_type->tp_base->tp_as_buffer && __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer) {
24837 : __pyx_memoryview_type->tp_as_buffer->bf_releasebuffer = __pyx_memoryview_type->tp_base->tp_as_buffer->bf_releasebuffer;
24838 : }
24839 : #elif defined(Py_bf_getbuffer) && defined(Py_bf_releasebuffer)
24840 : /* PY_VERSION_HEX >= 0x03090000 || Py_LIMITED_API >= 0x030B0000 */
24841 : #elif defined(_MSC_VER)
24842 : #pragma message ("The buffer protocol is not supported in the Limited C-API < 3.11.")
24843 : #else
24844 : #warning "The buffer protocol is not supported in the Limited C-API < 3.11."
24845 : #endif
24846 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryview_spec, __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
24847 : #else
24848 3 : __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
24849 : #endif
24850 : #if !CYTHON_COMPILING_IN_LIMITED_API
24851 : #endif
24852 : #if !CYTHON_USE_TYPE_SPECS
24853 3 : if (__Pyx_PyType_Ready(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
24854 : #endif
24855 : #if PY_MAJOR_VERSION < 3
24856 : __pyx_memoryview_type->tp_print = 0;
24857 : #endif
24858 : #if !CYTHON_COMPILING_IN_LIMITED_API
24859 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryview_type->tp_dictoffset && __pyx_memoryview_type->tp_getattro == PyObject_GenericGetAttr)) {
24860 3 : __pyx_memoryview_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
24861 : }
24862 : #endif
24863 3 : if (__Pyx_SetVtable(__pyx_memoryview_type, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
24864 : #if !CYTHON_COMPILING_IN_LIMITED_API
24865 3 : if (__Pyx_MergeVtables(__pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
24866 : #endif
24867 : #if !CYTHON_COMPILING_IN_LIMITED_API
24868 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryview_type) < 0) __PYX_ERR(1, 337, __pyx_L1_error)
24869 : #endif
24870 3 : __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
24871 3 : __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
24872 3 : __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
24873 3 : __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
24874 3 : __pyx_vtable__memoryviewslice.__pyx_base._get_base = (PyObject *(*)(struct __pyx_memoryview_obj *))__pyx_memoryviewslice__get_base;
24875 : #if CYTHON_USE_TYPE_SPECS
24876 : __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_memoryview_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 952, __pyx_L1_error)
24877 : __Pyx_GOTREF(__pyx_t_1);
24878 : __pyx_memoryviewslice_type = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type___pyx_memoryviewslice_spec, __pyx_t_1);
24879 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24880 : if (unlikely(!__pyx_memoryviewslice_type)) __PYX_ERR(1, 952, __pyx_L1_error)
24881 : if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type___pyx_memoryviewslice_spec, __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
24882 : #else
24883 3 : __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
24884 : #endif
24885 : #if !CYTHON_COMPILING_IN_LIMITED_API
24886 3 : __pyx_memoryviewslice_type->tp_base = __pyx_memoryview_type;
24887 : #endif
24888 : #if !CYTHON_USE_TYPE_SPECS
24889 3 : if (__Pyx_PyType_Ready(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
24890 : #endif
24891 : #if PY_MAJOR_VERSION < 3
24892 : __pyx_memoryviewslice_type->tp_print = 0;
24893 : #endif
24894 : #if !CYTHON_COMPILING_IN_LIMITED_API
24895 3 : if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_memoryviewslice_type->tp_dictoffset && __pyx_memoryviewslice_type->tp_getattro == PyObject_GenericGetAttr)) {
24896 3 : __pyx_memoryviewslice_type->tp_getattro = __Pyx_PyObject_GenericGetAttr;
24897 : }
24898 : #endif
24899 3 : if (__Pyx_SetVtable(__pyx_memoryviewslice_type, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
24900 : #if !CYTHON_COMPILING_IN_LIMITED_API
24901 3 : if (__Pyx_MergeVtables(__pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
24902 : #endif
24903 : #if !CYTHON_COMPILING_IN_LIMITED_API
24904 3 : if (__Pyx_setup_reduce((PyObject *) __pyx_memoryviewslice_type) < 0) __PYX_ERR(1, 952, __pyx_L1_error)
24905 : #endif
24906 : __Pyx_RefNannyFinishContext();
24907 : return 0;
24908 0 : __pyx_L1_error:;
24909 0 : __Pyx_XDECREF(__pyx_t_1);
24910 0 : __Pyx_RefNannyFinishContext();
24911 0 : return -1;
24912 : }
24913 :
24914 3 : static int __Pyx_modinit_type_import_code(void) {
24915 : __Pyx_RefNannyDeclarations
24916 3 : PyObject *__pyx_t_1 = NULL;
24917 3 : int __pyx_lineno = 0;
24918 3 : const char *__pyx_filename = NULL;
24919 3 : int __pyx_clineno = 0;
24920 3 : __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
24921 : /*--- Type import code ---*/
24922 3 : __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
24923 3 : __Pyx_GOTREF(__pyx_t_1);
24924 3 : __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
24925 : #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
24926 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
24927 : #elif CYTHON_COMPILING_IN_LIMITED_API
24928 : sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
24929 : #else
24930 : sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
24931 : #endif
24932 3 : __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
24933 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24934 3 : __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 271, __pyx_L1_error)
24935 3 : __Pyx_GOTREF(__pyx_t_1);
24936 3 : __pyx_ptype_5numpy_dtype = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArray_Descr),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 271, __pyx_L1_error)
24937 3 : __pyx_ptype_5numpy_flatiter = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 316, __pyx_L1_error)
24938 3 : __pyx_ptype_5numpy_broadcast = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayMultiIterObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 320, __pyx_L1_error)
24939 3 : __pyx_ptype_5numpy_ndarray = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyArrayObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 359, __pyx_L1_error)
24940 3 : __pyx_ptype_5numpy_generic = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 847, __pyx_L1_error)
24941 3 : __pyx_ptype_5numpy_number = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "number", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 849, __pyx_L1_error)
24942 3 : __pyx_ptype_5numpy_integer = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 851, __pyx_L1_error)
24943 3 : __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 853, __pyx_L1_error)
24944 3 : __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 855, __pyx_L1_error)
24945 3 : __pyx_ptype_5numpy_inexact = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 857, __pyx_L1_error)
24946 3 : __pyx_ptype_5numpy_floating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 859, __pyx_L1_error)
24947 3 : __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 861, __pyx_L1_error)
24948 3 : __pyx_ptype_5numpy_flexible = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 863, __pyx_L1_error)
24949 3 : __pyx_ptype_5numpy_character = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "character", sizeof(PyObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 865, __pyx_L1_error)
24950 3 : __pyx_ptype_5numpy_ufunc = __Pyx_ImportType_3_0_11(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyUFuncObject),__Pyx_ImportType_CheckSize_Ignore_3_0_11); if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 929, __pyx_L1_error)
24951 3 : __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24952 : __Pyx_RefNannyFinishContext();
24953 : return 0;
24954 0 : __pyx_L1_error:;
24955 0 : __Pyx_XDECREF(__pyx_t_1);
24956 0 : __Pyx_RefNannyFinishContext();
24957 0 : return -1;
24958 : }
24959 :
24960 : static int __Pyx_modinit_variable_import_code(void) {
24961 : __Pyx_RefNannyDeclarations
24962 : __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
24963 : /*--- Variable import code ---*/
24964 : __Pyx_RefNannyFinishContext();
24965 : return 0;
24966 : }
24967 :
24968 : static int __Pyx_modinit_function_import_code(void) {
24969 : __Pyx_RefNannyDeclarations
24970 : __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
24971 : /*--- Function import code ---*/
24972 : __Pyx_RefNannyFinishContext();
24973 : return 0;
24974 : }
24975 :
24976 :
24977 : #if PY_MAJOR_VERSION >= 3
24978 : #if CYTHON_PEP489_MULTI_PHASE_INIT
24979 : static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
24980 : static int __pyx_pymod_exec__peak_finding_utils(PyObject* module); /*proto*/
24981 : static PyModuleDef_Slot __pyx_moduledef_slots[] = {
24982 : {Py_mod_create, (void*)__pyx_pymod_create},
24983 : {Py_mod_exec, (void*)__pyx_pymod_exec__peak_finding_utils},
24984 : {0, NULL}
24985 : };
24986 : #endif
24987 :
24988 : #ifdef __cplusplus
24989 : namespace {
24990 : struct PyModuleDef __pyx_moduledef =
24991 : #else
24992 : static struct PyModuleDef __pyx_moduledef =
24993 : #endif
24994 : {
24995 : PyModuleDef_HEAD_INIT,
24996 : "_peak_finding_utils",
24997 : __pyx_k_Utility_functions_for_finding_pe, /* m_doc */
24998 : #if CYTHON_PEP489_MULTI_PHASE_INIT
24999 : 0, /* m_size */
25000 : #elif CYTHON_USE_MODULE_STATE
25001 : sizeof(__pyx_mstate), /* m_size */
25002 : #else
25003 : -1, /* m_size */
25004 : #endif
25005 : __pyx_methods /* m_methods */,
25006 : #if CYTHON_PEP489_MULTI_PHASE_INIT
25007 : __pyx_moduledef_slots, /* m_slots */
25008 : #else
25009 : NULL, /* m_reload */
25010 : #endif
25011 : #if CYTHON_USE_MODULE_STATE
25012 : __pyx_m_traverse, /* m_traverse */
25013 : __pyx_m_clear, /* m_clear */
25014 : NULL /* m_free */
25015 : #else
25016 : NULL, /* m_traverse */
25017 : NULL, /* m_clear */
25018 : NULL /* m_free */
25019 : #endif
25020 : };
25021 : #ifdef __cplusplus
25022 : } /* anonymous namespace */
25023 : #endif
25024 : #endif
25025 :
25026 : #ifndef CYTHON_NO_PYINIT_EXPORT
25027 : #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
25028 : #elif PY_MAJOR_VERSION < 3
25029 : #ifdef __cplusplus
25030 : #define __Pyx_PyMODINIT_FUNC extern "C" void
25031 : #else
25032 : #define __Pyx_PyMODINIT_FUNC void
25033 : #endif
25034 : #else
25035 : #ifdef __cplusplus
25036 : #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
25037 : #else
25038 : #define __Pyx_PyMODINIT_FUNC PyObject *
25039 : #endif
25040 : #endif
25041 :
25042 :
25043 : #if PY_MAJOR_VERSION < 3
25044 : __Pyx_PyMODINIT_FUNC init_peak_finding_utils(void) CYTHON_SMALL_CODE; /*proto*/
25045 : __Pyx_PyMODINIT_FUNC init_peak_finding_utils(void)
25046 : #else
25047 : __Pyx_PyMODINIT_FUNC PyInit__peak_finding_utils(void) CYTHON_SMALL_CODE; /*proto*/
25048 3 : __Pyx_PyMODINIT_FUNC PyInit__peak_finding_utils(void)
25049 : #if CYTHON_PEP489_MULTI_PHASE_INIT
25050 : {
25051 3 : return PyModuleDef_Init(&__pyx_moduledef);
25052 : }
25053 3 : static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
25054 : #if PY_VERSION_HEX >= 0x030700A1
25055 3 : static PY_INT64_T main_interpreter_id = -1;
25056 3 : PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
25057 3 : if (main_interpreter_id == -1) {
25058 3 : main_interpreter_id = current_id;
25059 6 : return (unlikely(current_id == -1)) ? -1 : 0;
25060 0 : } else if (unlikely(main_interpreter_id != current_id))
25061 : #else
25062 : static PyInterpreterState *main_interpreter = NULL;
25063 : PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
25064 : if (!main_interpreter) {
25065 : main_interpreter = current_interpreter;
25066 : } else if (unlikely(main_interpreter != current_interpreter))
25067 : #endif
25068 : {
25069 0 : PyErr_SetString(
25070 : PyExc_ImportError,
25071 : "Interpreter change detected - this module can only be loaded into one interpreter per process.");
25072 0 : return -1;
25073 : }
25074 : return 0;
25075 : }
25076 : #if CYTHON_COMPILING_IN_LIMITED_API
25077 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
25078 : #else
25079 12 : static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
25080 : #endif
25081 : {
25082 12 : PyObject *value = PyObject_GetAttrString(spec, from_name);
25083 12 : int result = 0;
25084 12 : if (likely(value)) {
25085 12 : if (allow_none || value != Py_None) {
25086 : #if CYTHON_COMPILING_IN_LIMITED_API
25087 : result = PyModule_AddObject(module, to_name, value);
25088 : #else
25089 9 : result = PyDict_SetItemString(moddict, to_name, value);
25090 : #endif
25091 : }
25092 12 : Py_DECREF(value);
25093 0 : } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
25094 0 : PyErr_Clear();
25095 : } else {
25096 : result = -1;
25097 : }
25098 12 : return result;
25099 : }
25100 3 : static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
25101 3 : PyObject *module = NULL, *moddict, *modname;
25102 3 : CYTHON_UNUSED_VAR(def);
25103 3 : if (__Pyx_check_single_interpreter())
25104 : return NULL;
25105 3 : if (__pyx_m)
25106 0 : return __Pyx_NewRef(__pyx_m);
25107 3 : modname = PyObject_GetAttrString(spec, "name");
25108 3 : if (unlikely(!modname)) goto bad;
25109 3 : module = PyModule_NewObject(modname);
25110 3 : Py_DECREF(modname);
25111 3 : if (unlikely(!module)) goto bad;
25112 : #if CYTHON_COMPILING_IN_LIMITED_API
25113 : moddict = module;
25114 : #else
25115 3 : moddict = PyModule_GetDict(module);
25116 3 : if (unlikely(!moddict)) goto bad;
25117 : #endif
25118 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
25119 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
25120 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
25121 3 : if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
25122 : return module;
25123 0 : bad:
25124 0 : Py_XDECREF(module);
25125 0 : return NULL;
25126 : }
25127 :
25128 :
25129 3 : static CYTHON_SMALL_CODE int __pyx_pymod_exec__peak_finding_utils(PyObject *__pyx_pyinit_module)
25130 : #endif
25131 : #endif
25132 : {
25133 3 : int stringtab_initialized = 0;
25134 : #if CYTHON_USE_MODULE_STATE
25135 : int pystate_addmodule_run = 0;
25136 : #endif
25137 3 : PyObject *__pyx_t_1 = NULL;
25138 3 : PyObject *__pyx_t_2 = NULL;
25139 3 : PyObject *__pyx_t_3 = NULL;
25140 3 : PyObject *__pyx_t_4 = NULL;
25141 3 : PyObject *__pyx_t_5 = NULL;
25142 3 : int __pyx_t_6;
25143 3 : PyObject *__pyx_t_7 = NULL;
25144 3 : static PyThread_type_lock __pyx_t_8[8];
25145 3 : int __pyx_t_9;
25146 3 : PyObject *__pyx_t_10 = NULL;
25147 3 : int __pyx_lineno = 0;
25148 3 : const char *__pyx_filename = NULL;
25149 3 : int __pyx_clineno = 0;
25150 : __Pyx_RefNannyDeclarations
25151 : #if CYTHON_PEP489_MULTI_PHASE_INIT
25152 3 : if (__pyx_m) {
25153 0 : if (__pyx_m == __pyx_pyinit_module) return 0;
25154 0 : PyErr_SetString(PyExc_RuntimeError, "Module '_peak_finding_utils' has already been imported. Re-initialisation is not supported.");
25155 0 : return -1;
25156 : }
25157 : #elif PY_MAJOR_VERSION >= 3
25158 : if (__pyx_m) return __Pyx_NewRef(__pyx_m);
25159 : #endif
25160 : /*--- Module creation code ---*/
25161 : #if CYTHON_PEP489_MULTI_PHASE_INIT
25162 3 : __pyx_m = __pyx_pyinit_module;
25163 3 : Py_INCREF(__pyx_m);
25164 : #else
25165 : #if PY_MAJOR_VERSION < 3
25166 : __pyx_m = Py_InitModule4("_peak_finding_utils", __pyx_methods, __pyx_k_Utility_functions_for_finding_pe, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
25167 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
25168 : #elif CYTHON_USE_MODULE_STATE
25169 : __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
25170 : {
25171 : int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
25172 : __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_peak_finding_utils" pseudovariable */
25173 : if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
25174 : pystate_addmodule_run = 1;
25175 : }
25176 : #else
25177 : __pyx_m = PyModule_Create(&__pyx_moduledef);
25178 : if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
25179 : #endif
25180 : #endif
25181 3 : CYTHON_UNUSED_VAR(__pyx_t_1);
25182 3 : __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
25183 3 : Py_INCREF(__pyx_d);
25184 3 : __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
25185 3 : __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
25186 3 : if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25187 : #if CYTHON_REFNANNY
25188 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
25189 : if (!__Pyx_RefNanny) {
25190 : PyErr_Clear();
25191 : __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
25192 : if (!__Pyx_RefNanny)
25193 : Py_FatalError("failed to import 'refnanny' module");
25194 : }
25195 : #endif
25196 3 : __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__peak_finding_utils(void)", 0);
25197 3 : if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25198 : #ifdef __Pxy_PyFrame_Initialize_Offsets
25199 : __Pxy_PyFrame_Initialize_Offsets();
25200 : #endif
25201 3 : __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
25202 3 : __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
25203 3 : __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
25204 : #ifdef __Pyx_CyFunction_USED
25205 3 : if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25206 : #endif
25207 : #ifdef __Pyx_FusedFunction_USED
25208 : if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25209 : #endif
25210 : #ifdef __Pyx_Coroutine_USED
25211 : if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25212 : #endif
25213 : #ifdef __Pyx_Generator_USED
25214 : if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25215 : #endif
25216 : #ifdef __Pyx_AsyncGen_USED
25217 : if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25218 : #endif
25219 : #ifdef __Pyx_StopAsyncIteration_USED
25220 : if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25221 : #endif
25222 : /*--- Library function declarations ---*/
25223 : /*--- Threads initialization code ---*/
25224 : #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
25225 : PyEval_InitThreads();
25226 : #endif
25227 : /*--- Initialize various global constants etc. ---*/
25228 3 : if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25229 3 : stringtab_initialized = 1;
25230 3 : if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25231 : #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
25232 : if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25233 : #endif
25234 3 : if (__pyx_module_is_main_scipy__signal___peak_finding_utils) {
25235 0 : if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25236 : }
25237 : #if PY_MAJOR_VERSION >= 3
25238 : {
25239 3 : PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
25240 3 : if (!PyDict_GetItemString(modules, "scipy.signal._peak_finding_utils")) {
25241 0 : if (unlikely((PyDict_SetItemString(modules, "scipy.signal._peak_finding_utils", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
25242 : }
25243 : }
25244 : #endif
25245 : /*--- Builtin init code ---*/
25246 3 : if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25247 : /*--- Constants init code ---*/
25248 3 : if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25249 : /*--- Global type/function init code ---*/
25250 3 : (void)__Pyx_modinit_global_init_code();
25251 3 : (void)__Pyx_modinit_variable_export_code();
25252 3 : (void)__Pyx_modinit_function_export_code();
25253 3 : if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
25254 3 : if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
25255 3 : (void)__Pyx_modinit_variable_import_code();
25256 3 : (void)__Pyx_modinit_function_import_code();
25257 : /*--- Execution code ---*/
25258 : #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
25259 : if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25260 : #endif
25261 :
25262 : /* "View.MemoryView":99
25263 : *
25264 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
25265 : * try: # <<<<<<<<<<<<<<
25266 : * if __import__("sys").version_info >= (3, 3):
25267 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
25268 : */
25269 : {
25270 3 : __Pyx_PyThreadState_declare
25271 3 : __Pyx_PyThreadState_assign
25272 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
25273 3 : __Pyx_XGOTREF(__pyx_t_1);
25274 3 : __Pyx_XGOTREF(__pyx_t_2);
25275 3 : __Pyx_XGOTREF(__pyx_t_3);
25276 : /*try:*/ {
25277 :
25278 : /* "View.MemoryView":100
25279 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
25280 : * try:
25281 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
25282 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
25283 : * else:
25284 : */
25285 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
25286 3 : __Pyx_GOTREF(__pyx_t_4);
25287 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 100, __pyx_L2_error)
25288 3 : __Pyx_GOTREF(__pyx_t_5);
25289 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25290 3 : __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_tuple__14, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 100, __pyx_L2_error)
25291 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25292 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 100, __pyx_L2_error)
25293 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25294 3 : if (__pyx_t_6) {
25295 :
25296 : /* "View.MemoryView":101
25297 : * try:
25298 : * if __import__("sys").version_info >= (3, 3):
25299 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence # <<<<<<<<<<<<<<
25300 : * else:
25301 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
25302 : */
25303 3 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
25304 3 : __Pyx_GOTREF(__pyx_t_4);
25305 3 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_abc); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 101, __pyx_L2_error)
25306 3 : __Pyx_GOTREF(__pyx_t_5);
25307 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25308 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 101, __pyx_L2_error)
25309 3 : __Pyx_GOTREF(__pyx_t_4);
25310 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25311 3 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
25312 3 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_4);
25313 3 : __Pyx_GIVEREF(__pyx_t_4);
25314 3 : __pyx_t_4 = 0;
25315 :
25316 : /* "View.MemoryView":100
25317 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
25318 : * try:
25319 : * if __import__("sys").version_info >= (3, 3): # <<<<<<<<<<<<<<
25320 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
25321 : * else:
25322 : */
25323 3 : goto __pyx_L8;
25324 : }
25325 :
25326 : /* "View.MemoryView":103
25327 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
25328 : * else:
25329 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence # <<<<<<<<<<<<<<
25330 : * except:
25331 : *
25332 : */
25333 : /*else*/ {
25334 0 : __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 103, __pyx_L2_error)
25335 0 : __Pyx_GOTREF(__pyx_t_4);
25336 0 : __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 103, __pyx_L2_error)
25337 0 : __Pyx_GOTREF(__pyx_t_5);
25338 0 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25339 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
25340 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, __pyx_t_5);
25341 0 : __Pyx_GIVEREF(__pyx_t_5);
25342 0 : __pyx_t_5 = 0;
25343 : }
25344 3 : __pyx_L8:;
25345 :
25346 : /* "View.MemoryView":99
25347 : *
25348 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
25349 : * try: # <<<<<<<<<<<<<<
25350 : * if __import__("sys").version_info >= (3, 3):
25351 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
25352 : */
25353 : }
25354 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25355 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25356 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25357 3 : goto __pyx_L7_try_end;
25358 0 : __pyx_L2_error:;
25359 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25360 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25361 :
25362 : /* "View.MemoryView":104
25363 : * else:
25364 : * __pyx_collections_abc_Sequence = __import__("collections").Sequence
25365 : * except: # <<<<<<<<<<<<<<
25366 : *
25367 : * __pyx_collections_abc_Sequence = None
25368 : */
25369 : /*except:*/ {
25370 0 : __Pyx_AddTraceback("View.MemoryView", __pyx_clineno, __pyx_lineno, __pyx_filename);
25371 0 : if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_4, &__pyx_t_7) < 0) __PYX_ERR(1, 104, __pyx_L4_except_error)
25372 0 : __Pyx_XGOTREF(__pyx_t_5);
25373 0 : __Pyx_XGOTREF(__pyx_t_4);
25374 0 : __Pyx_XGOTREF(__pyx_t_7);
25375 :
25376 : /* "View.MemoryView":106
25377 : * except:
25378 : *
25379 : * __pyx_collections_abc_Sequence = None # <<<<<<<<<<<<<<
25380 : *
25381 : *
25382 : */
25383 0 : __Pyx_INCREF(Py_None);
25384 0 : __Pyx_XGOTREF(__pyx_collections_abc_Sequence);
25385 0 : __Pyx_DECREF_SET(__pyx_collections_abc_Sequence, Py_None);
25386 0 : __Pyx_GIVEREF(Py_None);
25387 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25388 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25389 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
25390 0 : goto __pyx_L3_exception_handled;
25391 : }
25392 :
25393 : /* "View.MemoryView":99
25394 : *
25395 : * cdef object __pyx_collections_abc_Sequence "__pyx_collections_abc_Sequence"
25396 : * try: # <<<<<<<<<<<<<<
25397 : * if __import__("sys").version_info >= (3, 3):
25398 : * __pyx_collections_abc_Sequence = __import__("collections.abc").abc.Sequence
25399 : */
25400 0 : __pyx_L4_except_error:;
25401 0 : __Pyx_XGIVEREF(__pyx_t_1);
25402 0 : __Pyx_XGIVEREF(__pyx_t_2);
25403 0 : __Pyx_XGIVEREF(__pyx_t_3);
25404 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
25405 0 : goto __pyx_L1_error;
25406 0 : __pyx_L3_exception_handled:;
25407 0 : __Pyx_XGIVEREF(__pyx_t_1);
25408 0 : __Pyx_XGIVEREF(__pyx_t_2);
25409 0 : __Pyx_XGIVEREF(__pyx_t_3);
25410 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
25411 3 : __pyx_L7_try_end:;
25412 : }
25413 :
25414 : /* "View.MemoryView":241
25415 : *
25416 : *
25417 : * try: # <<<<<<<<<<<<<<
25418 : * count = __pyx_collections_abc_Sequence.count
25419 : * index = __pyx_collections_abc_Sequence.index
25420 : */
25421 : {
25422 3 : __Pyx_PyThreadState_declare
25423 3 : __Pyx_PyThreadState_assign
25424 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
25425 3 : __Pyx_XGOTREF(__pyx_t_3);
25426 3 : __Pyx_XGOTREF(__pyx_t_2);
25427 3 : __Pyx_XGOTREF(__pyx_t_1);
25428 : /*try:*/ {
25429 :
25430 : /* "View.MemoryView":242
25431 : *
25432 : * try:
25433 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
25434 : * index = __pyx_collections_abc_Sequence.index
25435 : * except:
25436 : */
25437 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 242, __pyx_L11_error)
25438 3 : __Pyx_GOTREF(__pyx_t_7);
25439 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 242, __pyx_L11_error)
25440 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25441 3 : PyType_Modified(__pyx_array_type);
25442 :
25443 : /* "View.MemoryView":243
25444 : * try:
25445 : * count = __pyx_collections_abc_Sequence.count
25446 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
25447 : * except:
25448 : * pass
25449 : */
25450 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 243, __pyx_L11_error)
25451 3 : __Pyx_GOTREF(__pyx_t_7);
25452 3 : if (__Pyx_SetItemOnTypeDict(__pyx_array_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 243, __pyx_L11_error)
25453 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25454 3 : PyType_Modified(__pyx_array_type);
25455 :
25456 : /* "View.MemoryView":241
25457 : *
25458 : *
25459 : * try: # <<<<<<<<<<<<<<
25460 : * count = __pyx_collections_abc_Sequence.count
25461 : * index = __pyx_collections_abc_Sequence.index
25462 : */
25463 : }
25464 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25465 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25466 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25467 3 : goto __pyx_L16_try_end;
25468 0 : __pyx_L11_error:;
25469 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25470 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25471 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
25472 :
25473 : /* "View.MemoryView":244
25474 : * count = __pyx_collections_abc_Sequence.count
25475 : * index = __pyx_collections_abc_Sequence.index
25476 : * except: # <<<<<<<<<<<<<<
25477 : * pass
25478 : *
25479 : */
25480 : /*except:*/ {
25481 0 : __Pyx_ErrRestore(0,0,0);
25482 0 : goto __pyx_L12_exception_handled;
25483 : }
25484 0 : __pyx_L12_exception_handled:;
25485 0 : __Pyx_XGIVEREF(__pyx_t_3);
25486 0 : __Pyx_XGIVEREF(__pyx_t_2);
25487 0 : __Pyx_XGIVEREF(__pyx_t_1);
25488 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
25489 3 : __pyx_L16_try_end:;
25490 : }
25491 :
25492 : /* "View.MemoryView":309
25493 : * return self.name
25494 : *
25495 : * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
25496 : * cdef strided = Enum("<strided and direct>") # default
25497 : * cdef indirect = Enum("<strided and indirect>")
25498 : */
25499 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 309, __pyx_L1_error)
25500 3 : __Pyx_GOTREF(__pyx_t_7);
25501 3 : __Pyx_XGOTREF(generic);
25502 3 : __Pyx_DECREF_SET(generic, __pyx_t_7);
25503 3 : __Pyx_GIVEREF(__pyx_t_7);
25504 3 : __pyx_t_7 = 0;
25505 :
25506 : /* "View.MemoryView":310
25507 : *
25508 : * cdef generic = Enum("<strided and direct or indirect>")
25509 : * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
25510 : * cdef indirect = Enum("<strided and indirect>")
25511 : *
25512 : */
25513 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 310, __pyx_L1_error)
25514 3 : __Pyx_GOTREF(__pyx_t_7);
25515 3 : __Pyx_XGOTREF(strided);
25516 3 : __Pyx_DECREF_SET(strided, __pyx_t_7);
25517 3 : __Pyx_GIVEREF(__pyx_t_7);
25518 3 : __pyx_t_7 = 0;
25519 :
25520 : /* "View.MemoryView":311
25521 : * cdef generic = Enum("<strided and direct or indirect>")
25522 : * cdef strided = Enum("<strided and direct>") # default
25523 : * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
25524 : *
25525 : *
25526 : */
25527 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 311, __pyx_L1_error)
25528 3 : __Pyx_GOTREF(__pyx_t_7);
25529 3 : __Pyx_XGOTREF(indirect);
25530 3 : __Pyx_DECREF_SET(indirect, __pyx_t_7);
25531 3 : __Pyx_GIVEREF(__pyx_t_7);
25532 3 : __pyx_t_7 = 0;
25533 :
25534 : /* "View.MemoryView":314
25535 : *
25536 : *
25537 : * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
25538 : * cdef indirect_contiguous = Enum("<contiguous and indirect>")
25539 : *
25540 : */
25541 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 314, __pyx_L1_error)
25542 3 : __Pyx_GOTREF(__pyx_t_7);
25543 3 : __Pyx_XGOTREF(contiguous);
25544 3 : __Pyx_DECREF_SET(contiguous, __pyx_t_7);
25545 3 : __Pyx_GIVEREF(__pyx_t_7);
25546 3 : __pyx_t_7 = 0;
25547 :
25548 : /* "View.MemoryView":315
25549 : *
25550 : * cdef contiguous = Enum("<contiguous and direct>")
25551 : * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
25552 : *
25553 : *
25554 : */
25555 3 : __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 315, __pyx_L1_error)
25556 3 : __Pyx_GOTREF(__pyx_t_7);
25557 3 : __Pyx_XGOTREF(indirect_contiguous);
25558 3 : __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7);
25559 3 : __Pyx_GIVEREF(__pyx_t_7);
25560 3 : __pyx_t_7 = 0;
25561 :
25562 : /* "View.MemoryView":323
25563 : *
25564 : *
25565 : * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
25566 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [
25567 : * PyThread_allocate_lock(),
25568 : */
25569 3 : __pyx_memoryview_thread_locks_used = 0;
25570 :
25571 : /* "View.MemoryView":324
25572 : *
25573 : * cdef int __pyx_memoryview_thread_locks_used = 0
25574 : * cdef PyThread_type_lock[8] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
25575 : * PyThread_allocate_lock(),
25576 : * PyThread_allocate_lock(),
25577 : */
25578 3 : __pyx_t_8[0] = PyThread_allocate_lock();
25579 3 : __pyx_t_8[1] = PyThread_allocate_lock();
25580 3 : __pyx_t_8[2] = PyThread_allocate_lock();
25581 3 : __pyx_t_8[3] = PyThread_allocate_lock();
25582 3 : __pyx_t_8[4] = PyThread_allocate_lock();
25583 3 : __pyx_t_8[5] = PyThread_allocate_lock();
25584 3 : __pyx_t_8[6] = PyThread_allocate_lock();
25585 3 : __pyx_t_8[7] = PyThread_allocate_lock();
25586 3 : memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
25587 :
25588 : /* "View.MemoryView":982
25589 : *
25590 : *
25591 : * try: # <<<<<<<<<<<<<<
25592 : * count = __pyx_collections_abc_Sequence.count
25593 : * index = __pyx_collections_abc_Sequence.index
25594 : */
25595 : {
25596 3 : __Pyx_PyThreadState_declare
25597 3 : __Pyx_PyThreadState_assign
25598 3 : __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
25599 3 : __Pyx_XGOTREF(__pyx_t_1);
25600 3 : __Pyx_XGOTREF(__pyx_t_2);
25601 3 : __Pyx_XGOTREF(__pyx_t_3);
25602 : /*try:*/ {
25603 :
25604 : /* "View.MemoryView":983
25605 : *
25606 : * try:
25607 : * count = __pyx_collections_abc_Sequence.count # <<<<<<<<<<<<<<
25608 : * index = __pyx_collections_abc_Sequence.index
25609 : * except:
25610 : */
25611 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 983, __pyx_L17_error)
25612 3 : __Pyx_GOTREF(__pyx_t_7);
25613 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_count, __pyx_t_7) < 0) __PYX_ERR(1, 983, __pyx_L17_error)
25614 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25615 3 : PyType_Modified(__pyx_memoryviewslice_type);
25616 :
25617 : /* "View.MemoryView":984
25618 : * try:
25619 : * count = __pyx_collections_abc_Sequence.count
25620 : * index = __pyx_collections_abc_Sequence.index # <<<<<<<<<<<<<<
25621 : * except:
25622 : * pass
25623 : */
25624 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 984, __pyx_L17_error)
25625 3 : __Pyx_GOTREF(__pyx_t_7);
25626 3 : if (__Pyx_SetItemOnTypeDict(__pyx_memoryviewslice_type, __pyx_n_s_index, __pyx_t_7) < 0) __PYX_ERR(1, 984, __pyx_L17_error)
25627 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25628 3 : PyType_Modified(__pyx_memoryviewslice_type);
25629 :
25630 : /* "View.MemoryView":982
25631 : *
25632 : *
25633 : * try: # <<<<<<<<<<<<<<
25634 : * count = __pyx_collections_abc_Sequence.count
25635 : * index = __pyx_collections_abc_Sequence.index
25636 : */
25637 : }
25638 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25639 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25640 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25641 3 : goto __pyx_L22_try_end;
25642 0 : __pyx_L17_error:;
25643 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25644 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25645 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
25646 :
25647 : /* "View.MemoryView":985
25648 : * count = __pyx_collections_abc_Sequence.count
25649 : * index = __pyx_collections_abc_Sequence.index
25650 : * except: # <<<<<<<<<<<<<<
25651 : * pass
25652 : *
25653 : */
25654 : /*except:*/ {
25655 0 : __Pyx_ErrRestore(0,0,0);
25656 0 : goto __pyx_L18_exception_handled;
25657 : }
25658 0 : __pyx_L18_exception_handled:;
25659 0 : __Pyx_XGIVEREF(__pyx_t_1);
25660 0 : __Pyx_XGIVEREF(__pyx_t_2);
25661 0 : __Pyx_XGIVEREF(__pyx_t_3);
25662 0 : __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
25663 3 : __pyx_L22_try_end:;
25664 : }
25665 :
25666 : /* "View.MemoryView":988
25667 : * pass
25668 : *
25669 : * try: # <<<<<<<<<<<<<<
25670 : * if __pyx_collections_abc_Sequence:
25671 : *
25672 : */
25673 : {
25674 3 : __Pyx_PyThreadState_declare
25675 3 : __Pyx_PyThreadState_assign
25676 3 : __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
25677 3 : __Pyx_XGOTREF(__pyx_t_3);
25678 3 : __Pyx_XGOTREF(__pyx_t_2);
25679 3 : __Pyx_XGOTREF(__pyx_t_1);
25680 : /*try:*/ {
25681 :
25682 : /* "View.MemoryView":989
25683 : *
25684 : * try:
25685 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
25686 : *
25687 : *
25688 : */
25689 3 : __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_collections_abc_Sequence); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(1, 989, __pyx_L23_error)
25690 3 : if (__pyx_t_6) {
25691 :
25692 : /* "View.MemoryView":993
25693 : *
25694 : *
25695 : * __pyx_collections_abc_Sequence.register(_memoryviewslice) # <<<<<<<<<<<<<<
25696 : * __pyx_collections_abc_Sequence.register(array)
25697 : * except:
25698 : */
25699 3 : __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 993, __pyx_L23_error)
25700 3 : __Pyx_GOTREF(__pyx_t_7);
25701 3 : __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)__pyx_memoryviewslice_type)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 993, __pyx_L23_error)
25702 3 : __Pyx_GOTREF(__pyx_t_4);
25703 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25704 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25705 :
25706 : /* "View.MemoryView":994
25707 : *
25708 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
25709 : * __pyx_collections_abc_Sequence.register(array) # <<<<<<<<<<<<<<
25710 : * except:
25711 : * pass # ignore failure, it's a minor issue
25712 : */
25713 3 : __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_collections_abc_Sequence, __pyx_n_s_register); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 994, __pyx_L23_error)
25714 3 : __Pyx_GOTREF(__pyx_t_4);
25715 3 : __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_array_type)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 994, __pyx_L23_error)
25716 3 : __Pyx_GOTREF(__pyx_t_7);
25717 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25718 6 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25719 :
25720 : /* "View.MemoryView":989
25721 : *
25722 : * try:
25723 : * if __pyx_collections_abc_Sequence: # <<<<<<<<<<<<<<
25724 : *
25725 : *
25726 : */
25727 : }
25728 :
25729 : /* "View.MemoryView":988
25730 : * pass
25731 : *
25732 : * try: # <<<<<<<<<<<<<<
25733 : * if __pyx_collections_abc_Sequence:
25734 : *
25735 : */
25736 : }
25737 3 : __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
25738 3 : __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25739 3 : __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
25740 3 : goto __pyx_L28_try_end;
25741 0 : __pyx_L23_error:;
25742 0 : __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25743 0 : __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25744 0 : __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
25745 :
25746 : /* "View.MemoryView":995
25747 : * __pyx_collections_abc_Sequence.register(_memoryviewslice)
25748 : * __pyx_collections_abc_Sequence.register(array)
25749 : * except: # <<<<<<<<<<<<<<
25750 : * pass # ignore failure, it's a minor issue
25751 : *
25752 : */
25753 : /*except:*/ {
25754 0 : __Pyx_ErrRestore(0,0,0);
25755 0 : goto __pyx_L24_exception_handled;
25756 : }
25757 0 : __pyx_L24_exception_handled:;
25758 0 : __Pyx_XGIVEREF(__pyx_t_3);
25759 0 : __Pyx_XGIVEREF(__pyx_t_2);
25760 0 : __Pyx_XGIVEREF(__pyx_t_1);
25761 0 : __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
25762 3 : __pyx_L28_try_end:;
25763 : }
25764 :
25765 : /* "(tree fragment)":1
25766 : * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
25767 : * cdef object __pyx_PickleError
25768 : * cdef object __pyx_result
25769 : */
25770 3 : __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error)
25771 3 : __Pyx_GOTREF(__pyx_t_7);
25772 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
25773 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25774 :
25775 : /* "scipy/signal/_peak_finding_utils.pyx":7
25776 : * """Utility functions for finding peaks in signals."""
25777 : *
25778 : * import warnings # <<<<<<<<<<<<<<
25779 : *
25780 : * import numpy as np
25781 : */
25782 3 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 7, __pyx_L1_error)
25783 3 : __Pyx_GOTREF(__pyx_t_7);
25784 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_7) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
25785 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25786 :
25787 : /* "scipy/signal/_peak_finding_utils.pyx":9
25788 : * import warnings
25789 : *
25790 : * import numpy as np # <<<<<<<<<<<<<<
25791 : *
25792 : * cimport numpy as np
25793 : */
25794 3 : __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_numpy, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 9, __pyx_L1_error)
25795 3 : __Pyx_GOTREF(__pyx_t_7);
25796 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_7) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
25797 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25798 :
25799 : /* "scipy/signal/_peak_finding_utils.pyx":14
25800 : * from libc.math cimport ceil
25801 : *
25802 : * np.import_array() # <<<<<<<<<<<<<<
25803 : *
25804 : * __all__ = ['_local_maxima_1d', '_select_by_peak_distance', '_peak_prominences',
25805 : */
25806 3 : __pyx_t_9 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 14, __pyx_L1_error)
25807 :
25808 : /* "scipy/signal/_peak_finding_utils.pyx":16
25809 : * np.import_array()
25810 : *
25811 : * __all__ = ['_local_maxima_1d', '_select_by_peak_distance', '_peak_prominences', # <<<<<<<<<<<<<<
25812 : * '_peak_widths']
25813 : *
25814 : */
25815 3 : __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 16, __pyx_L1_error)
25816 3 : __Pyx_GOTREF(__pyx_t_7);
25817 3 : __Pyx_INCREF(__pyx_n_u_local_maxima_1d);
25818 3 : __Pyx_GIVEREF(__pyx_n_u_local_maxima_1d);
25819 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_local_maxima_1d)) __PYX_ERR(0, 16, __pyx_L1_error);
25820 3 : __Pyx_INCREF(__pyx_n_u_select_by_peak_distance);
25821 3 : __Pyx_GIVEREF(__pyx_n_u_select_by_peak_distance);
25822 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_u_select_by_peak_distance)) __PYX_ERR(0, 16, __pyx_L1_error);
25823 3 : __Pyx_INCREF(__pyx_n_u_peak_prominences);
25824 3 : __Pyx_GIVEREF(__pyx_n_u_peak_prominences);
25825 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_u_peak_prominences)) __PYX_ERR(0, 16, __pyx_L1_error);
25826 3 : __Pyx_INCREF(__pyx_n_u_peak_widths);
25827 3 : __Pyx_GIVEREF(__pyx_n_u_peak_widths);
25828 3 : if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_n_u_peak_widths)) __PYX_ERR(0, 16, __pyx_L1_error);
25829 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_7) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
25830 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25831 :
25832 : /* "scipy/signal/_peak_finding_utils.pyx":20
25833 : *
25834 : *
25835 : * def _local_maxima_1d(const np.float64_t[::1] x not None): # <<<<<<<<<<<<<<
25836 : * """
25837 : * Find local maxima in a 1D array.
25838 : */
25839 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6signal_19_peak_finding_utils_1_local_maxima_1d, 0, __pyx_n_s_local_maxima_1d, NULL, __pyx_n_s_scipy_signal__peak_finding_utils, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 20, __pyx_L1_error)
25840 3 : __Pyx_GOTREF(__pyx_t_7);
25841 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_local_maxima_1d, __pyx_t_7) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
25842 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25843 :
25844 : /* "scipy/signal/_peak_finding_utils.pyx":91
25845 : *
25846 : *
25847 : * def _select_by_peak_distance(const np.intp_t[::1] peaks not None, # <<<<<<<<<<<<<<
25848 : * const np.float64_t[::1] priority not None,
25849 : * np.float64_t distance):
25850 : */
25851 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6signal_19_peak_finding_utils_3_select_by_peak_distance, 0, __pyx_n_s_select_by_peak_distance, NULL, __pyx_n_s_scipy_signal__peak_finding_utils, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 91, __pyx_L1_error)
25852 3 : __Pyx_GOTREF(__pyx_t_7);
25853 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_select_by_peak_distance, __pyx_t_7) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
25854 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25855 :
25856 : /* "scipy/signal/_peak_finding_utils.pyx":161
25857 : *
25858 : *
25859 : * class PeakPropertyWarning(RuntimeWarning): # <<<<<<<<<<<<<<
25860 : * """Calculated property of a peak has unexpected value."""
25861 : * pass
25862 : */
25863 3 : __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_tuple__29); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error)
25864 3 : __Pyx_GOTREF(__pyx_t_7);
25865 3 : __pyx_t_4 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
25866 3 : __Pyx_GOTREF(__pyx_t_4);
25867 3 : __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_4, __pyx_t_7, __pyx_n_s_PeakPropertyWarning, __pyx_n_s_PeakPropertyWarning, (PyObject *) NULL, __pyx_n_s_scipy_signal__peak_finding_utils, __pyx_kp_s_Calculated_property_of_a_peak_ha); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
25868 3 : __Pyx_GOTREF(__pyx_t_5);
25869 3 : if (__pyx_t_7 != __pyx_tuple__29) {
25870 0 : if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_tuple__29) < 0))) __PYX_ERR(0, 161, __pyx_L1_error)
25871 : }
25872 3 : __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_4, __pyx_n_s_PeakPropertyWarning, __pyx_t_7, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 161, __pyx_L1_error)
25873 3 : __Pyx_GOTREF(__pyx_t_10);
25874 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_PeakPropertyWarning, __pyx_t_10) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
25875 3 : __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
25876 3 : __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25877 3 : __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25878 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25879 :
25880 : /* "scipy/signal/_peak_finding_utils.pyx":166
25881 : *
25882 : *
25883 : * def _peak_prominences(const np.float64_t[::1] x not None, # <<<<<<<<<<<<<<
25884 : * const np.intp_t[::1] peaks not None,
25885 : * np.intp_t wlen):
25886 : */
25887 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6signal_19_peak_finding_utils_5_peak_prominences, 0, __pyx_n_s_peak_prominences, NULL, __pyx_n_s_scipy_signal__peak_finding_utils, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error)
25888 3 : __Pyx_GOTREF(__pyx_t_7);
25889 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_peak_prominences, __pyx_t_7) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
25890 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25891 :
25892 : /* "scipy/signal/_peak_finding_utils.pyx":264
25893 : *
25894 : *
25895 : * def _peak_widths(const np.float64_t[::1] x not None, # <<<<<<<<<<<<<<
25896 : * const np.intp_t[::1] peaks not None,
25897 : * np.float64_t rel_height,
25898 : */
25899 3 : __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_5scipy_6signal_19_peak_finding_utils_7_peak_widths, 0, __pyx_n_s_peak_widths, NULL, __pyx_n_s_scipy_signal__peak_finding_utils, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error)
25900 3 : __Pyx_GOTREF(__pyx_t_7);
25901 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_peak_widths, __pyx_t_7) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
25902 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25903 :
25904 : /* "scipy/signal/_peak_finding_utils.pyx":1
25905 : * #cython: wraparound=False # <<<<<<<<<<<<<<
25906 : * #cython: boundscheck=False
25907 : * #cython: nonecheck=False
25908 : */
25909 3 : __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
25910 3 : __Pyx_GOTREF(__pyx_t_7);
25911 3 : if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25912 3 : __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25913 :
25914 : /*--- Wrapped vars code ---*/
25915 :
25916 3 : goto __pyx_L0;
25917 0 : __pyx_L1_error:;
25918 0 : __Pyx_XDECREF(__pyx_t_4);
25919 0 : __Pyx_XDECREF(__pyx_t_5);
25920 0 : __Pyx_XDECREF(__pyx_t_7);
25921 0 : __Pyx_XDECREF(__pyx_t_10);
25922 0 : if (__pyx_m) {
25923 0 : if (__pyx_d && stringtab_initialized) {
25924 0 : __Pyx_AddTraceback("init scipy.signal._peak_finding_utils", __pyx_clineno, __pyx_lineno, __pyx_filename);
25925 : }
25926 : #if !CYTHON_USE_MODULE_STATE
25927 0 : Py_CLEAR(__pyx_m);
25928 : #else
25929 : Py_DECREF(__pyx_m);
25930 : if (pystate_addmodule_run) {
25931 : PyObject *tp, *value, *tb;
25932 : PyErr_Fetch(&tp, &value, &tb);
25933 : PyState_RemoveModule(&__pyx_moduledef);
25934 : PyErr_Restore(tp, value, tb);
25935 : }
25936 : #endif
25937 0 : } else if (!PyErr_Occurred()) {
25938 0 : PyErr_SetString(PyExc_ImportError, "init scipy.signal._peak_finding_utils");
25939 : }
25940 0 : __pyx_L0:;
25941 3 : __Pyx_RefNannyFinishContext();
25942 : #if CYTHON_PEP489_MULTI_PHASE_INIT
25943 3 : return (__pyx_m != NULL) ? 0 : -1;
25944 : #elif PY_MAJOR_VERSION >= 3
25945 : return __pyx_m;
25946 : #else
25947 : return;
25948 : #endif
25949 : }
25950 : /* #### Code section: cleanup_globals ### */
25951 : /* #### Code section: cleanup_module ### */
25952 : /* #### Code section: main_method ### */
25953 : /* #### Code section: utility_code_pragmas ### */
25954 : #ifdef _MSC_VER
25955 : #pragma warning( push )
25956 : /* Warning 4127: conditional expression is constant
25957 : * Cython uses constant conditional expressions to allow in inline functions to be optimized at
25958 : * compile-time, so this warning is not useful
25959 : */
25960 : #pragma warning( disable : 4127 )
25961 : #endif
25962 :
25963 :
25964 :
25965 : /* #### Code section: utility_code_def ### */
25966 :
25967 : /* --- Runtime support code --- */
25968 : /* Refnanny */
25969 : #if CYTHON_REFNANNY
25970 : static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
25971 : PyObject *m = NULL, *p = NULL;
25972 : void *r = NULL;
25973 : m = PyImport_ImportModule(modname);
25974 : if (!m) goto end;
25975 : p = PyObject_GetAttrString(m, "RefNannyAPI");
25976 : if (!p) goto end;
25977 : r = PyLong_AsVoidPtr(p);
25978 : end:
25979 : Py_XDECREF(p);
25980 : Py_XDECREF(m);
25981 : return (__Pyx_RefNannyAPIStruct *)r;
25982 : }
25983 : #endif
25984 :
25985 : /* PyErrExceptionMatches */
25986 : #if CYTHON_FAST_THREAD_STATE
25987 0 : static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25988 0 : Py_ssize_t i, n;
25989 0 : n = PyTuple_GET_SIZE(tuple);
25990 : #if PY_MAJOR_VERSION >= 3
25991 0 : for (i=0; i<n; i++) {
25992 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25993 : }
25994 : #endif
25995 0 : for (i=0; i<n; i++) {
25996 0 : if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
25997 : }
25998 : return 0;
25999 : }
26000 9 : static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
26001 9 : int result;
26002 9 : PyObject *exc_type;
26003 : #if PY_VERSION_HEX >= 0x030C00A6
26004 9 : PyObject *current_exception = tstate->current_exception;
26005 9 : if (unlikely(!current_exception)) return 0;
26006 9 : exc_type = (PyObject*) Py_TYPE(current_exception);
26007 9 : if (exc_type == err) return 1;
26008 : #else
26009 : exc_type = tstate->curexc_type;
26010 : if (exc_type == err) return 1;
26011 : if (unlikely(!exc_type)) return 0;
26012 : #endif
26013 : #if CYTHON_AVOID_BORROWED_REFS
26014 : Py_INCREF(exc_type);
26015 : #endif
26016 0 : if (unlikely(PyTuple_Check(err))) {
26017 0 : result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
26018 : } else {
26019 0 : result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
26020 : }
26021 : #if CYTHON_AVOID_BORROWED_REFS
26022 : Py_DECREF(exc_type);
26023 : #endif
26024 : return result;
26025 : }
26026 : #endif
26027 :
26028 : /* PyErrFetchRestore */
26029 : #if CYTHON_FAST_THREAD_STATE
26030 36 : static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
26031 : #if PY_VERSION_HEX >= 0x030C00A6
26032 36 : PyObject *tmp_value;
26033 36 : assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
26034 36 : if (value) {
26035 : #if CYTHON_COMPILING_IN_CPYTHON
26036 27 : if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
26037 : #endif
26038 0 : PyException_SetTraceback(value, tb);
26039 : }
26040 36 : tmp_value = tstate->current_exception;
26041 36 : tstate->current_exception = value;
26042 36 : Py_XDECREF(tmp_value);
26043 36 : Py_XDECREF(type);
26044 36 : Py_XDECREF(tb);
26045 : #else
26046 : PyObject *tmp_type, *tmp_value, *tmp_tb;
26047 : tmp_type = tstate->curexc_type;
26048 : tmp_value = tstate->curexc_value;
26049 : tmp_tb = tstate->curexc_traceback;
26050 : tstate->curexc_type = type;
26051 : tstate->curexc_value = value;
26052 : tstate->curexc_traceback = tb;
26053 : Py_XDECREF(tmp_type);
26054 : Py_XDECREF(tmp_value);
26055 : Py_XDECREF(tmp_tb);
26056 : #endif
26057 36 : }
26058 27 : static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
26059 : #if PY_VERSION_HEX >= 0x030C00A6
26060 27 : PyObject* exc_value;
26061 27 : exc_value = tstate->current_exception;
26062 27 : tstate->current_exception = 0;
26063 27 : *value = exc_value;
26064 27 : *type = NULL;
26065 27 : *tb = NULL;
26066 27 : if (exc_value) {
26067 27 : *type = (PyObject*) Py_TYPE(exc_value);
26068 27 : Py_INCREF(*type);
26069 : #if CYTHON_COMPILING_IN_CPYTHON
26070 27 : *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
26071 27 : Py_XINCREF(*tb);
26072 : #else
26073 : *tb = PyException_GetTraceback(exc_value);
26074 : #endif
26075 : }
26076 : #else
26077 : *type = tstate->curexc_type;
26078 : *value = tstate->curexc_value;
26079 : *tb = tstate->curexc_traceback;
26080 : tstate->curexc_type = 0;
26081 : tstate->curexc_value = 0;
26082 : tstate->curexc_traceback = 0;
26083 : #endif
26084 27 : }
26085 : #endif
26086 :
26087 : /* PyObjectGetAttrStr */
26088 : #if CYTHON_USE_TYPE_SLOTS
26089 1397 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
26090 1397 : PyTypeObject* tp = Py_TYPE(obj);
26091 1397 : if (likely(tp->tp_getattro))
26092 1397 : return tp->tp_getattro(obj, attr_name);
26093 : #if PY_MAJOR_VERSION < 3
26094 : if (likely(tp->tp_getattr))
26095 : return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
26096 : #endif
26097 0 : return PyObject_GetAttr(obj, attr_name);
26098 : }
26099 : #endif
26100 :
26101 : /* PyObjectGetAttrStrNoError */
26102 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
26103 9 : static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
26104 9 : __Pyx_PyThreadState_declare
26105 9 : __Pyx_PyThreadState_assign
26106 9 : if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
26107 9 : __Pyx_PyErr_Clear();
26108 9 : }
26109 : #endif
26110 93 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
26111 93 : PyObject *result;
26112 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
26113 : (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
26114 : return result;
26115 : #else
26116 : #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
26117 93 : PyTypeObject* tp = Py_TYPE(obj);
26118 93 : if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
26119 12 : return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
26120 : }
26121 : #endif
26122 81 : result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
26123 81 : if (unlikely(!result)) {
26124 9 : __Pyx_PyObject_GetAttrStr_ClearAttributeError();
26125 : }
26126 : return result;
26127 : #endif
26128 : }
26129 :
26130 : /* GetBuiltinName */
26131 36 : static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
26132 36 : PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
26133 36 : if (unlikely(!result) && !PyErr_Occurred()) {
26134 0 : PyErr_Format(PyExc_NameError,
26135 : #if PY_MAJOR_VERSION >= 3
26136 : "name '%U' is not defined", name);
26137 : #else
26138 : "name '%.200s' is not defined", PyString_AS_STRING(name));
26139 : #endif
26140 : }
26141 36 : return result;
26142 : }
26143 :
26144 : /* TupleAndListFromArray */
26145 : #if CYTHON_COMPILING_IN_CPYTHON
26146 : static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
26147 : PyObject *v;
26148 : Py_ssize_t i;
26149 : for (i = 0; i < length; i++) {
26150 : v = dest[i] = src[i];
26151 : Py_INCREF(v);
26152 : }
26153 : }
26154 : static CYTHON_INLINE PyObject *
26155 : __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
26156 : {
26157 : PyObject *res;
26158 : if (n <= 0) {
26159 : Py_INCREF(__pyx_empty_tuple);
26160 : return __pyx_empty_tuple;
26161 : }
26162 : res = PyTuple_New(n);
26163 : if (unlikely(res == NULL)) return NULL;
26164 : __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
26165 : return res;
26166 : }
26167 : static CYTHON_INLINE PyObject *
26168 : __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
26169 : {
26170 : PyObject *res;
26171 : if (n <= 0) {
26172 : return PyList_New(0);
26173 : }
26174 : res = PyList_New(n);
26175 : if (unlikely(res == NULL)) return NULL;
26176 : __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
26177 : return res;
26178 : }
26179 : #endif
26180 :
26181 : /* BytesEquals */
26182 : static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
26183 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
26184 : return PyObject_RichCompareBool(s1, s2, equals);
26185 : #else
26186 : if (s1 == s2) {
26187 : return (equals == Py_EQ);
26188 : } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
26189 : const char *ps1, *ps2;
26190 : Py_ssize_t length = PyBytes_GET_SIZE(s1);
26191 : if (length != PyBytes_GET_SIZE(s2))
26192 : return (equals == Py_NE);
26193 : ps1 = PyBytes_AS_STRING(s1);
26194 : ps2 = PyBytes_AS_STRING(s2);
26195 : if (ps1[0] != ps2[0]) {
26196 : return (equals == Py_NE);
26197 : } else if (length == 1) {
26198 : return (equals == Py_EQ);
26199 : } else {
26200 : int result;
26201 : #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
26202 : Py_hash_t hash1, hash2;
26203 : hash1 = ((PyBytesObject*)s1)->ob_shash;
26204 : hash2 = ((PyBytesObject*)s2)->ob_shash;
26205 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26206 : return (equals == Py_NE);
26207 : }
26208 : #endif
26209 : result = memcmp(ps1, ps2, (size_t)length);
26210 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
26211 : }
26212 : } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
26213 : return (equals == Py_NE);
26214 : } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
26215 : return (equals == Py_NE);
26216 : } else {
26217 : int result;
26218 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26219 : if (!py_result)
26220 : return -1;
26221 : result = __Pyx_PyObject_IsTrue(py_result);
26222 : Py_DECREF(py_result);
26223 : return result;
26224 : }
26225 : #endif
26226 : }
26227 :
26228 : /* UnicodeEquals */
26229 0 : static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
26230 : #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
26231 : return PyObject_RichCompareBool(s1, s2, equals);
26232 : #else
26233 : #if PY_MAJOR_VERSION < 3
26234 : PyObject* owned_ref = NULL;
26235 : #endif
26236 0 : int s1_is_unicode, s2_is_unicode;
26237 0 : if (s1 == s2) {
26238 0 : goto return_eq;
26239 : }
26240 0 : s1_is_unicode = PyUnicode_CheckExact(s1);
26241 0 : s2_is_unicode = PyUnicode_CheckExact(s2);
26242 : #if PY_MAJOR_VERSION < 3
26243 : if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
26244 : owned_ref = PyUnicode_FromObject(s2);
26245 : if (unlikely(!owned_ref))
26246 : return -1;
26247 : s2 = owned_ref;
26248 : s2_is_unicode = 1;
26249 : } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
26250 : owned_ref = PyUnicode_FromObject(s1);
26251 : if (unlikely(!owned_ref))
26252 : return -1;
26253 : s1 = owned_ref;
26254 : s1_is_unicode = 1;
26255 : } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
26256 : return __Pyx_PyBytes_Equals(s1, s2, equals);
26257 : }
26258 : #endif
26259 0 : if (s1_is_unicode & s2_is_unicode) {
26260 0 : Py_ssize_t length;
26261 0 : int kind;
26262 0 : void *data1, *data2;
26263 0 : if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
26264 : return -1;
26265 0 : length = __Pyx_PyUnicode_GET_LENGTH(s1);
26266 0 : if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
26267 0 : goto return_ne;
26268 : }
26269 : #if CYTHON_USE_UNICODE_INTERNALS
26270 : {
26271 0 : Py_hash_t hash1, hash2;
26272 : #if CYTHON_PEP393_ENABLED
26273 0 : hash1 = ((PyASCIIObject*)s1)->hash;
26274 0 : hash2 = ((PyASCIIObject*)s2)->hash;
26275 : #else
26276 : hash1 = ((PyUnicodeObject*)s1)->hash;
26277 : hash2 = ((PyUnicodeObject*)s2)->hash;
26278 : #endif
26279 0 : if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
26280 0 : goto return_ne;
26281 : }
26282 : }
26283 : #endif
26284 0 : kind = __Pyx_PyUnicode_KIND(s1);
26285 0 : if (kind != __Pyx_PyUnicode_KIND(s2)) {
26286 0 : goto return_ne;
26287 : }
26288 0 : data1 = __Pyx_PyUnicode_DATA(s1);
26289 0 : data2 = __Pyx_PyUnicode_DATA(s2);
26290 0 : if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
26291 0 : goto return_ne;
26292 0 : } else if (length == 1) {
26293 0 : goto return_eq;
26294 : } else {
26295 0 : int result = memcmp(data1, data2, (size_t)(length * kind));
26296 : #if PY_MAJOR_VERSION < 3
26297 : Py_XDECREF(owned_ref);
26298 : #endif
26299 0 : return (equals == Py_EQ) ? (result == 0) : (result != 0);
26300 : }
26301 0 : } else if ((s1 == Py_None) & s2_is_unicode) {
26302 0 : goto return_ne;
26303 0 : } else if ((s2 == Py_None) & s1_is_unicode) {
26304 0 : goto return_ne;
26305 : } else {
26306 0 : int result;
26307 0 : PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
26308 : #if PY_MAJOR_VERSION < 3
26309 : Py_XDECREF(owned_ref);
26310 : #endif
26311 0 : if (!py_result)
26312 : return -1;
26313 0 : result = __Pyx_PyObject_IsTrue(py_result);
26314 0 : Py_DECREF(py_result);
26315 0 : return result;
26316 : }
26317 0 : return_eq:
26318 : #if PY_MAJOR_VERSION < 3
26319 : Py_XDECREF(owned_ref);
26320 : #endif
26321 0 : return (equals == Py_EQ);
26322 0 : return_ne:
26323 : #if PY_MAJOR_VERSION < 3
26324 : Py_XDECREF(owned_ref);
26325 : #endif
26326 0 : return (equals == Py_NE);
26327 : #endif
26328 : }
26329 :
26330 : /* fastcall */
26331 : #if CYTHON_METH_FASTCALL
26332 7 : static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
26333 : {
26334 7 : Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
26335 7 : for (i = 0; i < n; i++)
26336 : {
26337 7 : if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
26338 : }
26339 0 : for (i = 0; i < n; i++)
26340 : {
26341 0 : int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
26342 0 : if (unlikely(eq != 0)) {
26343 0 : if (unlikely(eq < 0)) return NULL;
26344 0 : return kwvalues[i];
26345 : }
26346 : }
26347 : return NULL;
26348 : }
26349 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
26350 : CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
26351 : Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
26352 : PyObject *dict;
26353 : dict = PyDict_New();
26354 : if (unlikely(!dict))
26355 : return NULL;
26356 : for (i=0; i<nkwargs; i++) {
26357 : PyObject *key = PyTuple_GET_ITEM(kwnames, i);
26358 : if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
26359 : goto bad;
26360 : }
26361 : return dict;
26362 : bad:
26363 : Py_DECREF(dict);
26364 : return NULL;
26365 : }
26366 : #endif
26367 : #endif
26368 :
26369 : /* RaiseArgTupleInvalid */
26370 0 : static void __Pyx_RaiseArgtupleInvalid(
26371 : const char* func_name,
26372 : int exact,
26373 : Py_ssize_t num_min,
26374 : Py_ssize_t num_max,
26375 : Py_ssize_t num_found)
26376 : {
26377 0 : Py_ssize_t num_expected;
26378 0 : const char *more_or_less;
26379 0 : if (num_found < num_min) {
26380 : num_expected = num_min;
26381 : more_or_less = "at least";
26382 : } else {
26383 0 : num_expected = num_max;
26384 0 : more_or_less = "at most";
26385 : }
26386 0 : if (exact) {
26387 0 : more_or_less = "exactly";
26388 : }
26389 0 : PyErr_Format(PyExc_TypeError,
26390 : "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
26391 : func_name, more_or_less, num_expected,
26392 : (num_expected == 1) ? "" : "s", num_found);
26393 0 : }
26394 :
26395 : /* RaiseDoubleKeywords */
26396 0 : static void __Pyx_RaiseDoubleKeywordsError(
26397 : const char* func_name,
26398 : PyObject* kw_name)
26399 : {
26400 0 : PyErr_Format(PyExc_TypeError,
26401 : #if PY_MAJOR_VERSION >= 3
26402 : "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
26403 : #else
26404 : "%s() got multiple values for keyword argument '%s'", func_name,
26405 : PyString_AsString(kw_name));
26406 : #endif
26407 : }
26408 :
26409 : /* ParseKeywords */
26410 0 : static int __Pyx_ParseOptionalKeywords(
26411 : PyObject *kwds,
26412 : PyObject *const *kwvalues,
26413 : PyObject **argnames[],
26414 : PyObject *kwds2,
26415 : PyObject *values[],
26416 : Py_ssize_t num_pos_args,
26417 : const char* function_name)
26418 : {
26419 0 : PyObject *key = 0, *value = 0;
26420 0 : Py_ssize_t pos = 0;
26421 0 : PyObject*** name;
26422 0 : PyObject*** first_kw_arg = argnames + num_pos_args;
26423 0 : int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
26424 0 : while (1) {
26425 0 : Py_XDECREF(key); key = NULL;
26426 0 : Py_XDECREF(value); value = NULL;
26427 0 : if (kwds_is_tuple) {
26428 0 : Py_ssize_t size;
26429 : #if CYTHON_ASSUME_SAFE_MACROS
26430 0 : size = PyTuple_GET_SIZE(kwds);
26431 : #else
26432 : size = PyTuple_Size(kwds);
26433 : if (size < 0) goto bad;
26434 : #endif
26435 0 : if (pos >= size) break;
26436 : #if CYTHON_AVOID_BORROWED_REFS
26437 : key = __Pyx_PySequence_ITEM(kwds, pos);
26438 : if (!key) goto bad;
26439 : #elif CYTHON_ASSUME_SAFE_MACROS
26440 0 : key = PyTuple_GET_ITEM(kwds, pos);
26441 : #else
26442 : key = PyTuple_GetItem(kwds, pos);
26443 : if (!key) goto bad;
26444 : #endif
26445 0 : value = kwvalues[pos];
26446 0 : pos++;
26447 : }
26448 : else
26449 : {
26450 0 : if (!PyDict_Next(kwds, &pos, &key, &value)) break;
26451 : #if CYTHON_AVOID_BORROWED_REFS
26452 : Py_INCREF(key);
26453 : #endif
26454 : }
26455 0 : name = first_kw_arg;
26456 0 : while (*name && (**name != key)) name++;
26457 0 : if (*name) {
26458 0 : values[name-argnames] = value;
26459 : #if CYTHON_AVOID_BORROWED_REFS
26460 : Py_INCREF(value);
26461 : Py_DECREF(key);
26462 : #endif
26463 0 : key = NULL;
26464 0 : value = NULL;
26465 0 : continue;
26466 : }
26467 : #if !CYTHON_AVOID_BORROWED_REFS
26468 0 : Py_INCREF(key);
26469 : #endif
26470 0 : Py_INCREF(value);
26471 0 : name = first_kw_arg;
26472 : #if PY_MAJOR_VERSION < 3
26473 : if (likely(PyString_Check(key))) {
26474 : while (*name) {
26475 : if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
26476 : && _PyString_Eq(**name, key)) {
26477 : values[name-argnames] = value;
26478 : #if CYTHON_AVOID_BORROWED_REFS
26479 : value = NULL;
26480 : #endif
26481 : break;
26482 : }
26483 : name++;
26484 : }
26485 : if (*name) continue;
26486 : else {
26487 : PyObject*** argname = argnames;
26488 : while (argname != first_kw_arg) {
26489 : if ((**argname == key) || (
26490 : (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
26491 : && _PyString_Eq(**argname, key))) {
26492 : goto arg_passed_twice;
26493 : }
26494 : argname++;
26495 : }
26496 : }
26497 : } else
26498 : #endif
26499 0 : if (likely(PyUnicode_Check(key))) {
26500 0 : while (*name) {
26501 0 : int cmp = (
26502 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
26503 0 : (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
26504 : #endif
26505 0 : PyUnicode_Compare(**name, key)
26506 : );
26507 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
26508 0 : if (cmp == 0) {
26509 0 : values[name-argnames] = value;
26510 : #if CYTHON_AVOID_BORROWED_REFS
26511 : value = NULL;
26512 : #endif
26513 0 : break;
26514 : }
26515 0 : name++;
26516 : }
26517 0 : if (*name) continue;
26518 : else {
26519 : PyObject*** argname = argnames;
26520 0 : while (argname != first_kw_arg) {
26521 0 : int cmp = (**argname == key) ? 0 :
26522 : #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
26523 0 : (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
26524 : #endif
26525 0 : PyUnicode_Compare(**argname, key);
26526 0 : if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
26527 0 : if (cmp == 0) goto arg_passed_twice;
26528 0 : argname++;
26529 : }
26530 : }
26531 : } else
26532 0 : goto invalid_keyword_type;
26533 0 : if (kwds2) {
26534 0 : if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
26535 : } else {
26536 0 : goto invalid_keyword;
26537 : }
26538 : }
26539 0 : Py_XDECREF(key);
26540 0 : Py_XDECREF(value);
26541 0 : return 0;
26542 0 : arg_passed_twice:
26543 0 : __Pyx_RaiseDoubleKeywordsError(function_name, key);
26544 0 : goto bad;
26545 0 : invalid_keyword_type:
26546 0 : PyErr_Format(PyExc_TypeError,
26547 : "%.200s() keywords must be strings", function_name);
26548 0 : goto bad;
26549 0 : invalid_keyword:
26550 : #if PY_MAJOR_VERSION < 3
26551 : PyErr_Format(PyExc_TypeError,
26552 : "%.200s() got an unexpected keyword argument '%.200s'",
26553 : function_name, PyString_AsString(key));
26554 : #else
26555 0 : PyErr_Format(PyExc_TypeError,
26556 : "%s() got an unexpected keyword argument '%U'",
26557 : function_name, key);
26558 : #endif
26559 0 : bad:
26560 0 : Py_XDECREF(key);
26561 0 : Py_XDECREF(value);
26562 0 : return -1;
26563 : }
26564 :
26565 : /* ArgTypeTest */
26566 0 : static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
26567 : {
26568 0 : __Pyx_TypeName type_name;
26569 0 : __Pyx_TypeName obj_type_name;
26570 0 : if (unlikely(!type)) {
26571 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
26572 0 : return 0;
26573 : }
26574 0 : else if (exact) {
26575 : #if PY_MAJOR_VERSION == 2
26576 : if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
26577 : #endif
26578 : }
26579 : else {
26580 0 : if (likely(__Pyx_TypeCheck(obj, type))) return 1;
26581 : }
26582 0 : type_name = __Pyx_PyType_GetName(type);
26583 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
26584 0 : PyErr_Format(PyExc_TypeError,
26585 : "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
26586 : ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
26587 0 : __Pyx_DECREF_TypeName(type_name);
26588 0 : __Pyx_DECREF_TypeName(obj_type_name);
26589 0 : return 0;
26590 : }
26591 :
26592 : /* RaiseException */
26593 : #if PY_MAJOR_VERSION < 3
26594 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26595 : __Pyx_PyThreadState_declare
26596 : CYTHON_UNUSED_VAR(cause);
26597 : Py_XINCREF(type);
26598 : if (!value || value == Py_None)
26599 : value = NULL;
26600 : else
26601 : Py_INCREF(value);
26602 : if (!tb || tb == Py_None)
26603 : tb = NULL;
26604 : else {
26605 : Py_INCREF(tb);
26606 : if (!PyTraceBack_Check(tb)) {
26607 : PyErr_SetString(PyExc_TypeError,
26608 : "raise: arg 3 must be a traceback or None");
26609 : goto raise_error;
26610 : }
26611 : }
26612 : if (PyType_Check(type)) {
26613 : #if CYTHON_COMPILING_IN_PYPY
26614 : if (!value) {
26615 : Py_INCREF(Py_None);
26616 : value = Py_None;
26617 : }
26618 : #endif
26619 : PyErr_NormalizeException(&type, &value, &tb);
26620 : } else {
26621 : if (value) {
26622 : PyErr_SetString(PyExc_TypeError,
26623 : "instance exception may not have a separate value");
26624 : goto raise_error;
26625 : }
26626 : value = type;
26627 : type = (PyObject*) Py_TYPE(type);
26628 : Py_INCREF(type);
26629 : if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
26630 : PyErr_SetString(PyExc_TypeError,
26631 : "raise: exception class must be a subclass of BaseException");
26632 : goto raise_error;
26633 : }
26634 : }
26635 : __Pyx_PyThreadState_assign
26636 : __Pyx_ErrRestore(type, value, tb);
26637 : return;
26638 : raise_error:
26639 : Py_XDECREF(value);
26640 : Py_XDECREF(type);
26641 : Py_XDECREF(tb);
26642 : return;
26643 : }
26644 : #else
26645 15 : static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
26646 15 : PyObject* owned_instance = NULL;
26647 15 : if (tb == Py_None) {
26648 : tb = 0;
26649 15 : } else if (tb && !PyTraceBack_Check(tb)) {
26650 0 : PyErr_SetString(PyExc_TypeError,
26651 : "raise: arg 3 must be a traceback or None");
26652 0 : goto bad;
26653 : }
26654 15 : if (value == Py_None)
26655 0 : value = 0;
26656 15 : if (PyExceptionInstance_Check(type)) {
26657 15 : if (value) {
26658 0 : PyErr_SetString(PyExc_TypeError,
26659 : "instance exception may not have a separate value");
26660 0 : goto bad;
26661 : }
26662 : value = type;
26663 : type = (PyObject*) Py_TYPE(value);
26664 0 : } else if (PyExceptionClass_Check(type)) {
26665 0 : PyObject *instance_class = NULL;
26666 0 : if (value && PyExceptionInstance_Check(value)) {
26667 0 : instance_class = (PyObject*) Py_TYPE(value);
26668 0 : if (instance_class != type) {
26669 0 : int is_subclass = PyObject_IsSubclass(instance_class, type);
26670 0 : if (!is_subclass) {
26671 : instance_class = NULL;
26672 0 : } else if (unlikely(is_subclass == -1)) {
26673 0 : goto bad;
26674 : } else {
26675 : type = instance_class;
26676 : }
26677 : }
26678 : }
26679 : if (!instance_class) {
26680 0 : PyObject *args;
26681 0 : if (!value)
26682 0 : args = PyTuple_New(0);
26683 0 : else if (PyTuple_Check(value)) {
26684 0 : Py_INCREF(value);
26685 0 : args = value;
26686 : } else
26687 0 : args = PyTuple_Pack(1, value);
26688 0 : if (!args)
26689 0 : goto bad;
26690 0 : owned_instance = PyObject_Call(type, args, NULL);
26691 0 : Py_DECREF(args);
26692 0 : if (!owned_instance)
26693 0 : goto bad;
26694 0 : value = owned_instance;
26695 0 : if (!PyExceptionInstance_Check(value)) {
26696 0 : PyErr_Format(PyExc_TypeError,
26697 : "calling %R should have returned an instance of "
26698 : "BaseException, not %R",
26699 : type, Py_TYPE(value));
26700 0 : goto bad;
26701 : }
26702 : }
26703 : } else {
26704 0 : PyErr_SetString(PyExc_TypeError,
26705 : "raise: exception class must be a subclass of BaseException");
26706 0 : goto bad;
26707 : }
26708 15 : if (cause) {
26709 0 : PyObject *fixed_cause;
26710 0 : if (cause == Py_None) {
26711 : fixed_cause = NULL;
26712 0 : } else if (PyExceptionClass_Check(cause)) {
26713 0 : fixed_cause = PyObject_CallObject(cause, NULL);
26714 0 : if (fixed_cause == NULL)
26715 0 : goto bad;
26716 0 : } else if (PyExceptionInstance_Check(cause)) {
26717 0 : fixed_cause = cause;
26718 0 : Py_INCREF(fixed_cause);
26719 : } else {
26720 0 : PyErr_SetString(PyExc_TypeError,
26721 : "exception causes must derive from "
26722 : "BaseException");
26723 0 : goto bad;
26724 : }
26725 0 : PyException_SetCause(value, fixed_cause);
26726 : }
26727 15 : PyErr_SetObject(type, value);
26728 15 : if (tb) {
26729 : #if PY_VERSION_HEX >= 0x030C00A6
26730 0 : PyException_SetTraceback(value, tb);
26731 : #elif CYTHON_FAST_THREAD_STATE
26732 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
26733 : PyObject* tmp_tb = tstate->curexc_traceback;
26734 : if (tb != tmp_tb) {
26735 : Py_INCREF(tb);
26736 : tstate->curexc_traceback = tb;
26737 : Py_XDECREF(tmp_tb);
26738 : }
26739 : #else
26740 : PyObject *tmp_type, *tmp_value, *tmp_tb;
26741 : PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
26742 : Py_INCREF(tb);
26743 : PyErr_Restore(tmp_type, tmp_value, tb);
26744 : Py_XDECREF(tmp_tb);
26745 : #endif
26746 : }
26747 15 : bad:
26748 15 : Py_XDECREF(owned_instance);
26749 15 : return;
26750 : }
26751 : #endif
26752 :
26753 : /* PyFunctionFastCall */
26754 : #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
26755 : static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
26756 : PyObject *globals) {
26757 : PyFrameObject *f;
26758 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
26759 : PyObject **fastlocals;
26760 : Py_ssize_t i;
26761 : PyObject *result;
26762 : assert(globals != NULL);
26763 : /* XXX Perhaps we should create a specialized
26764 : PyFrame_New() that doesn't take locals, but does
26765 : take builtins without sanity checking them.
26766 : */
26767 : assert(tstate != NULL);
26768 : f = PyFrame_New(tstate, co, globals, NULL);
26769 : if (f == NULL) {
26770 : return NULL;
26771 : }
26772 : fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
26773 : for (i = 0; i < na; i++) {
26774 : Py_INCREF(*args);
26775 : fastlocals[i] = *args++;
26776 : }
26777 : result = PyEval_EvalFrameEx(f,0);
26778 : ++tstate->recursion_depth;
26779 : Py_DECREF(f);
26780 : --tstate->recursion_depth;
26781 : return result;
26782 : }
26783 : static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
26784 : PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
26785 : PyObject *globals = PyFunction_GET_GLOBALS(func);
26786 : PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
26787 : PyObject *closure;
26788 : #if PY_MAJOR_VERSION >= 3
26789 : PyObject *kwdefs;
26790 : #endif
26791 : PyObject *kwtuple, **k;
26792 : PyObject **d;
26793 : Py_ssize_t nd;
26794 : Py_ssize_t nk;
26795 : PyObject *result;
26796 : assert(kwargs == NULL || PyDict_Check(kwargs));
26797 : nk = kwargs ? PyDict_Size(kwargs) : 0;
26798 : #if PY_MAJOR_VERSION < 3
26799 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
26800 : return NULL;
26801 : }
26802 : #else
26803 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
26804 : return NULL;
26805 : }
26806 : #endif
26807 : if (
26808 : #if PY_MAJOR_VERSION >= 3
26809 : co->co_kwonlyargcount == 0 &&
26810 : #endif
26811 : likely(kwargs == NULL || nk == 0) &&
26812 : co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
26813 : if (argdefs == NULL && co->co_argcount == nargs) {
26814 : result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
26815 : goto done;
26816 : }
26817 : else if (nargs == 0 && argdefs != NULL
26818 : && co->co_argcount == Py_SIZE(argdefs)) {
26819 : /* function called with no arguments, but all parameters have
26820 : a default value: use default values as arguments .*/
26821 : args = &PyTuple_GET_ITEM(argdefs, 0);
26822 : result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
26823 : goto done;
26824 : }
26825 : }
26826 : if (kwargs != NULL) {
26827 : Py_ssize_t pos, i;
26828 : kwtuple = PyTuple_New(2 * nk);
26829 : if (kwtuple == NULL) {
26830 : result = NULL;
26831 : goto done;
26832 : }
26833 : k = &PyTuple_GET_ITEM(kwtuple, 0);
26834 : pos = i = 0;
26835 : while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
26836 : Py_INCREF(k[i]);
26837 : Py_INCREF(k[i+1]);
26838 : i += 2;
26839 : }
26840 : nk = i / 2;
26841 : }
26842 : else {
26843 : kwtuple = NULL;
26844 : k = NULL;
26845 : }
26846 : closure = PyFunction_GET_CLOSURE(func);
26847 : #if PY_MAJOR_VERSION >= 3
26848 : kwdefs = PyFunction_GET_KW_DEFAULTS(func);
26849 : #endif
26850 : if (argdefs != NULL) {
26851 : d = &PyTuple_GET_ITEM(argdefs, 0);
26852 : nd = Py_SIZE(argdefs);
26853 : }
26854 : else {
26855 : d = NULL;
26856 : nd = 0;
26857 : }
26858 : #if PY_MAJOR_VERSION >= 3
26859 : result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
26860 : args, (int)nargs,
26861 : k, (int)nk,
26862 : d, (int)nd, kwdefs, closure);
26863 : #else
26864 : result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
26865 : args, (int)nargs,
26866 : k, (int)nk,
26867 : d, (int)nd, closure);
26868 : #endif
26869 : Py_XDECREF(kwtuple);
26870 : done:
26871 : Py_LeaveRecursiveCall();
26872 : return result;
26873 : }
26874 : #endif
26875 :
26876 : /* PyObjectCall */
26877 : #if CYTHON_COMPILING_IN_CPYTHON
26878 1135 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26879 1135 : PyObject *result;
26880 1135 : ternaryfunc call = Py_TYPE(func)->tp_call;
26881 1135 : if (unlikely(!call))
26882 0 : return PyObject_Call(func, arg, kw);
26883 : #if PY_MAJOR_VERSION < 3
26884 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
26885 : return NULL;
26886 : #else
26887 1135 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
26888 : return NULL;
26889 : #endif
26890 1135 : result = (*call)(func, arg, kw);
26891 1135 : Py_LeaveRecursiveCall();
26892 1135 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
26893 0 : PyErr_SetString(
26894 : PyExc_SystemError,
26895 : "NULL result without error in PyObject_Call");
26896 : }
26897 : return result;
26898 : }
26899 : #endif
26900 :
26901 : /* PyObjectCallMethO */
26902 : #if CYTHON_COMPILING_IN_CPYTHON
26903 0 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
26904 0 : PyObject *self, *result;
26905 0 : PyCFunction cfunc;
26906 0 : cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
26907 0 : self = __Pyx_CyOrPyCFunction_GET_SELF(func);
26908 : #if PY_MAJOR_VERSION < 3
26909 : if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
26910 : return NULL;
26911 : #else
26912 0 : if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
26913 : return NULL;
26914 : #endif
26915 0 : result = cfunc(self, arg);
26916 0 : Py_LeaveRecursiveCall();
26917 0 : if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
26918 0 : PyErr_SetString(
26919 : PyExc_SystemError,
26920 : "NULL result without error in PyObject_Call");
26921 : }
26922 : return result;
26923 : }
26924 : #endif
26925 :
26926 : /* PyObjectFastCall */
26927 : #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
26928 : static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
26929 : PyObject *argstuple;
26930 : PyObject *result = 0;
26931 : size_t i;
26932 : argstuple = PyTuple_New((Py_ssize_t)nargs);
26933 : if (unlikely(!argstuple)) return NULL;
26934 : for (i = 0; i < nargs; i++) {
26935 : Py_INCREF(args[i]);
26936 : if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
26937 : }
26938 : result = __Pyx_PyObject_Call(func, argstuple, kwargs);
26939 : bad:
26940 : Py_DECREF(argstuple);
26941 : return result;
26942 : }
26943 : #endif
26944 36 : static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
26945 36 : Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
26946 : #if CYTHON_COMPILING_IN_CPYTHON
26947 36 : if (nargs == 0 && kwargs == NULL) {
26948 0 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
26949 0 : return __Pyx_PyObject_CallMethO(func, NULL);
26950 : }
26951 36 : else if (nargs == 1 && kwargs == NULL) {
26952 30 : if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
26953 0 : return __Pyx_PyObject_CallMethO(func, args[0]);
26954 : }
26955 : #endif
26956 : #if PY_VERSION_HEX < 0x030800B1
26957 : #if CYTHON_FAST_PYCCALL
26958 : if (PyCFunction_Check(func)) {
26959 : if (kwargs) {
26960 : return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
26961 : } else {
26962 : return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
26963 : }
26964 : }
26965 : #if PY_VERSION_HEX >= 0x030700A1
26966 : if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
26967 : return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
26968 : }
26969 : #endif
26970 : #endif
26971 : #if CYTHON_FAST_PYCALL
26972 : if (PyFunction_Check(func)) {
26973 : return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
26974 : }
26975 : #endif
26976 : #endif
26977 36 : if (kwargs == NULL) {
26978 : #if CYTHON_VECTORCALL
26979 : #if PY_VERSION_HEX < 0x03090000
26980 : vectorcallfunc f = _PyVectorcall_Function(func);
26981 : #else
26982 36 : vectorcallfunc f = PyVectorcall_Function(func);
26983 : #endif
26984 36 : if (f) {
26985 16 : return f(func, args, (size_t)nargs, NULL);
26986 : }
26987 : #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
26988 : if (__Pyx_CyFunction_CheckExact(func)) {
26989 : __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
26990 : if (f) return f(func, args, (size_t)nargs, NULL);
26991 : }
26992 : #endif
26993 : }
26994 20 : if (nargs == 0) {
26995 0 : return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
26996 : }
26997 : #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
26998 20 : return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
26999 : #else
27000 : return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
27001 : #endif
27002 : }
27003 :
27004 : /* RaiseUnexpectedTypeError */
27005 : static int
27006 0 : __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
27007 : {
27008 0 : __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
27009 0 : PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
27010 : expected, obj_type_name);
27011 0 : __Pyx_DECREF_TypeName(obj_type_name);
27012 0 : return 0;
27013 : }
27014 :
27015 : /* CIntToDigits */
27016 : static const char DIGIT_PAIRS_10[2*10*10+1] = {
27017 : "00010203040506070809"
27018 : "10111213141516171819"
27019 : "20212223242526272829"
27020 : "30313233343536373839"
27021 : "40414243444546474849"
27022 : "50515253545556575859"
27023 : "60616263646566676869"
27024 : "70717273747576777879"
27025 : "80818283848586878889"
27026 : "90919293949596979899"
27027 : };
27028 : static const char DIGIT_PAIRS_8[2*8*8+1] = {
27029 : "0001020304050607"
27030 : "1011121314151617"
27031 : "2021222324252627"
27032 : "3031323334353637"
27033 : "4041424344454647"
27034 : "5051525354555657"
27035 : "6061626364656667"
27036 : "7071727374757677"
27037 : };
27038 : static const char DIGITS_HEX[2*16+1] = {
27039 : "0123456789abcdef"
27040 : "0123456789ABCDEF"
27041 : };
27042 :
27043 : /* BuildPyUnicode */
27044 0 : static PyObject* __Pyx_PyUnicode_BuildFromAscii(Py_ssize_t ulength, char* chars, int clength,
27045 : int prepend_sign, char padding_char) {
27046 0 : PyObject *uval;
27047 0 : Py_ssize_t uoffset = ulength - clength;
27048 : #if CYTHON_USE_UNICODE_INTERNALS
27049 0 : Py_ssize_t i;
27050 : #if CYTHON_PEP393_ENABLED
27051 0 : void *udata;
27052 0 : uval = PyUnicode_New(ulength, 127);
27053 0 : if (unlikely(!uval)) return NULL;
27054 0 : udata = PyUnicode_DATA(uval);
27055 : #else
27056 : Py_UNICODE *udata;
27057 : uval = PyUnicode_FromUnicode(NULL, ulength);
27058 : if (unlikely(!uval)) return NULL;
27059 : udata = PyUnicode_AS_UNICODE(uval);
27060 : #endif
27061 0 : if (uoffset > 0) {
27062 0 : i = 0;
27063 0 : if (prepend_sign) {
27064 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, 0, '-');
27065 0 : i++;
27066 : }
27067 0 : for (; i < uoffset; i++) {
27068 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, i, padding_char);
27069 : }
27070 : }
27071 0 : for (i=0; i < clength; i++) {
27072 0 : __Pyx_PyUnicode_WRITE(PyUnicode_1BYTE_KIND, udata, uoffset+i, chars[i]);
27073 : }
27074 : #else
27075 : {
27076 : PyObject *sign = NULL, *padding = NULL;
27077 : uval = NULL;
27078 : if (uoffset > 0) {
27079 : prepend_sign = !!prepend_sign;
27080 : if (uoffset > prepend_sign) {
27081 : padding = PyUnicode_FromOrdinal(padding_char);
27082 : if (likely(padding) && uoffset > prepend_sign + 1) {
27083 : PyObject *tmp;
27084 : PyObject *repeat = PyInt_FromSsize_t(uoffset - prepend_sign);
27085 : if (unlikely(!repeat)) goto done_or_error;
27086 : tmp = PyNumber_Multiply(padding, repeat);
27087 : Py_DECREF(repeat);
27088 : Py_DECREF(padding);
27089 : padding = tmp;
27090 : }
27091 : if (unlikely(!padding)) goto done_or_error;
27092 : }
27093 : if (prepend_sign) {
27094 : sign = PyUnicode_FromOrdinal('-');
27095 : if (unlikely(!sign)) goto done_or_error;
27096 : }
27097 : }
27098 : uval = PyUnicode_DecodeASCII(chars, clength, NULL);
27099 : if (likely(uval) && padding) {
27100 : PyObject *tmp = PyNumber_Add(padding, uval);
27101 : Py_DECREF(uval);
27102 : uval = tmp;
27103 : }
27104 : if (likely(uval) && sign) {
27105 : PyObject *tmp = PyNumber_Add(sign, uval);
27106 : Py_DECREF(uval);
27107 : uval = tmp;
27108 : }
27109 : done_or_error:
27110 : Py_XDECREF(padding);
27111 : Py_XDECREF(sign);
27112 : }
27113 : #endif
27114 : return uval;
27115 : }
27116 :
27117 : /* CIntToPyUnicode */
27118 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_int(int value, Py_ssize_t width, char padding_char, char format_char) {
27119 0 : char digits[sizeof(int)*3+2];
27120 0 : char *dpos, *end = digits + sizeof(int)*3+2;
27121 0 : const char *hex_digits = DIGITS_HEX;
27122 0 : Py_ssize_t length, ulength;
27123 0 : int prepend_sign, last_one_off;
27124 0 : int remaining;
27125 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27126 : #pragma GCC diagnostic push
27127 : #pragma GCC diagnostic ignored "-Wconversion"
27128 : #endif
27129 0 : const int neg_one = (int) -1, const_zero = (int) 0;
27130 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27131 : #pragma GCC diagnostic pop
27132 : #endif
27133 0 : const int is_unsigned = neg_one > const_zero;
27134 0 : if (format_char == 'X') {
27135 0 : hex_digits += 16;
27136 0 : format_char = 'x';
27137 : }
27138 0 : remaining = value;
27139 0 : last_one_off = 0;
27140 0 : dpos = end;
27141 0 : do {
27142 0 : int digit_pos;
27143 0 : switch (format_char) {
27144 0 : case 'o':
27145 0 : digit_pos = abs((int)(remaining % (8*8)));
27146 0 : remaining = (int) (remaining / (8*8));
27147 0 : dpos -= 2;
27148 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
27149 0 : last_one_off = (digit_pos < 8);
27150 0 : break;
27151 0 : case 'd':
27152 0 : digit_pos = abs((int)(remaining % (10*10)));
27153 0 : remaining = (int) (remaining / (10*10));
27154 0 : dpos -= 2;
27155 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
27156 0 : last_one_off = (digit_pos < 10);
27157 0 : break;
27158 0 : case 'x':
27159 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
27160 0 : remaining = (int) (remaining / 16);
27161 0 : break;
27162 : default:
27163 : assert(0);
27164 : break;
27165 : }
27166 0 : } while (unlikely(remaining != 0));
27167 0 : assert(!last_one_off || *dpos == '0');
27168 0 : dpos += last_one_off;
27169 0 : length = end - dpos;
27170 0 : ulength = length;
27171 0 : prepend_sign = 0;
27172 0 : if (!is_unsigned && value <= neg_one) {
27173 0 : if (padding_char == ' ' || width <= length + 1) {
27174 0 : *(--dpos) = '-';
27175 0 : ++length;
27176 : } else {
27177 : prepend_sign = 1;
27178 : }
27179 0 : ++ulength;
27180 : }
27181 0 : if (width > ulength) {
27182 : ulength = width;
27183 : }
27184 0 : if (ulength == 1) {
27185 0 : return PyUnicode_FromOrdinal(*dpos);
27186 : }
27187 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
27188 : }
27189 :
27190 : /* CIntToPyUnicode */
27191 0 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_From_Py_ssize_t(Py_ssize_t value, Py_ssize_t width, char padding_char, char format_char) {
27192 0 : char digits[sizeof(Py_ssize_t)*3+2];
27193 0 : char *dpos, *end = digits + sizeof(Py_ssize_t)*3+2;
27194 0 : const char *hex_digits = DIGITS_HEX;
27195 0 : Py_ssize_t length, ulength;
27196 0 : int prepend_sign, last_one_off;
27197 0 : Py_ssize_t remaining;
27198 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27199 : #pragma GCC diagnostic push
27200 : #pragma GCC diagnostic ignored "-Wconversion"
27201 : #endif
27202 0 : const Py_ssize_t neg_one = (Py_ssize_t) -1, const_zero = (Py_ssize_t) 0;
27203 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27204 : #pragma GCC diagnostic pop
27205 : #endif
27206 0 : const int is_unsigned = neg_one > const_zero;
27207 0 : if (format_char == 'X') {
27208 0 : hex_digits += 16;
27209 0 : format_char = 'x';
27210 : }
27211 0 : remaining = value;
27212 0 : last_one_off = 0;
27213 0 : dpos = end;
27214 0 : do {
27215 0 : int digit_pos;
27216 0 : switch (format_char) {
27217 0 : case 'o':
27218 0 : digit_pos = abs((int)(remaining % (8*8)));
27219 0 : remaining = (Py_ssize_t) (remaining / (8*8));
27220 0 : dpos -= 2;
27221 0 : memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2);
27222 0 : last_one_off = (digit_pos < 8);
27223 0 : break;
27224 0 : case 'd':
27225 0 : digit_pos = abs((int)(remaining % (10*10)));
27226 0 : remaining = (Py_ssize_t) (remaining / (10*10));
27227 0 : dpos -= 2;
27228 0 : memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2);
27229 0 : last_one_off = (digit_pos < 10);
27230 0 : break;
27231 0 : case 'x':
27232 0 : *(--dpos) = hex_digits[abs((int)(remaining % 16))];
27233 0 : remaining = (Py_ssize_t) (remaining / 16);
27234 0 : break;
27235 : default:
27236 : assert(0);
27237 : break;
27238 : }
27239 0 : } while (unlikely(remaining != 0));
27240 0 : assert(!last_one_off || *dpos == '0');
27241 0 : dpos += last_one_off;
27242 0 : length = end - dpos;
27243 0 : ulength = length;
27244 0 : prepend_sign = 0;
27245 0 : if (!is_unsigned && value <= neg_one) {
27246 0 : if (padding_char == ' ' || width <= length + 1) {
27247 0 : *(--dpos) = '-';
27248 0 : ++length;
27249 : } else {
27250 : prepend_sign = 1;
27251 : }
27252 0 : ++ulength;
27253 : }
27254 0 : if (width > ulength) {
27255 : ulength = width;
27256 : }
27257 0 : if (ulength == 1) {
27258 0 : return PyUnicode_FromOrdinal(*dpos);
27259 : }
27260 0 : return __Pyx_PyUnicode_BuildFromAscii(ulength, dpos, (int) length, prepend_sign, padding_char);
27261 : }
27262 :
27263 : /* JoinPyUnicode */
27264 0 : static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
27265 : Py_UCS4 max_char) {
27266 : #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27267 0 : PyObject *result_uval;
27268 0 : int result_ukind, kind_shift;
27269 0 : Py_ssize_t i, char_pos;
27270 0 : void *result_udata;
27271 0 : CYTHON_MAYBE_UNUSED_VAR(max_char);
27272 : #if CYTHON_PEP393_ENABLED
27273 0 : result_uval = PyUnicode_New(result_ulength, max_char);
27274 0 : if (unlikely(!result_uval)) return NULL;
27275 0 : result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
27276 0 : kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
27277 0 : result_udata = PyUnicode_DATA(result_uval);
27278 : #else
27279 : result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
27280 : if (unlikely(!result_uval)) return NULL;
27281 : result_ukind = sizeof(Py_UNICODE);
27282 : kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
27283 : result_udata = PyUnicode_AS_UNICODE(result_uval);
27284 : #endif
27285 0 : assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
27286 0 : char_pos = 0;
27287 0 : for (i=0; i < value_count; i++) {
27288 0 : int ukind;
27289 0 : Py_ssize_t ulength;
27290 0 : void *udata;
27291 0 : PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
27292 0 : if (unlikely(__Pyx_PyUnicode_READY(uval)))
27293 : goto bad;
27294 0 : ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
27295 0 : if (unlikely(!ulength))
27296 0 : continue;
27297 0 : if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
27298 0 : goto overflow;
27299 0 : ukind = __Pyx_PyUnicode_KIND(uval);
27300 0 : udata = __Pyx_PyUnicode_DATA(uval);
27301 0 : if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
27302 0 : memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
27303 : } else {
27304 : #if PY_VERSION_HEX >= 0x030d0000
27305 : if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
27306 : #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
27307 0 : _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
27308 : #else
27309 : Py_ssize_t j;
27310 : for (j=0; j < ulength; j++) {
27311 : Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
27312 : __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
27313 : }
27314 : #endif
27315 : }
27316 0 : char_pos += ulength;
27317 : }
27318 : return result_uval;
27319 0 : overflow:
27320 0 : PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
27321 0 : bad:
27322 0 : Py_DECREF(result_uval);
27323 : return NULL;
27324 : #else
27325 : CYTHON_UNUSED_VAR(max_char);
27326 : CYTHON_UNUSED_VAR(result_ulength);
27327 : CYTHON_UNUSED_VAR(value_count);
27328 : return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
27329 : #endif
27330 : }
27331 :
27332 : /* GetAttr */
27333 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
27334 : #if CYTHON_USE_TYPE_SLOTS
27335 : #if PY_MAJOR_VERSION >= 3
27336 0 : if (likely(PyUnicode_Check(n)))
27337 : #else
27338 : if (likely(PyString_Check(n)))
27339 : #endif
27340 0 : return __Pyx_PyObject_GetAttrStr(o, n);
27341 : #endif
27342 0 : return PyObject_GetAttr(o, n);
27343 : }
27344 :
27345 : /* GetItemInt */
27346 0 : static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
27347 0 : PyObject *r;
27348 0 : if (unlikely(!j)) return NULL;
27349 0 : r = PyObject_GetItem(o, j);
27350 0 : Py_DECREF(j);
27351 : return r;
27352 : }
27353 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
27354 : CYTHON_NCP_UNUSED int wraparound,
27355 : CYTHON_NCP_UNUSED int boundscheck) {
27356 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27357 : Py_ssize_t wrapped_i = i;
27358 : if (wraparound & unlikely(i < 0)) {
27359 : wrapped_i += PyList_GET_SIZE(o);
27360 : }
27361 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
27362 : PyObject *r = PyList_GET_ITEM(o, wrapped_i);
27363 : Py_INCREF(r);
27364 : return r;
27365 : }
27366 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27367 : #else
27368 : return PySequence_GetItem(o, i);
27369 : #endif
27370 : }
27371 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
27372 : CYTHON_NCP_UNUSED int wraparound,
27373 : CYTHON_NCP_UNUSED int boundscheck) {
27374 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
27375 0 : Py_ssize_t wrapped_i = i;
27376 0 : if (wraparound & unlikely(i < 0)) {
27377 0 : wrapped_i += PyTuple_GET_SIZE(o);
27378 : }
27379 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
27380 0 : PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
27381 0 : Py_INCREF(r);
27382 0 : return r;
27383 : }
27384 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27385 : #else
27386 : return PySequence_GetItem(o, i);
27387 : #endif
27388 : }
27389 0 : static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
27390 : CYTHON_NCP_UNUSED int wraparound,
27391 : CYTHON_NCP_UNUSED int boundscheck) {
27392 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
27393 0 : if (is_list || PyList_CheckExact(o)) {
27394 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
27395 0 : if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
27396 0 : PyObject *r = PyList_GET_ITEM(o, n);
27397 0 : Py_INCREF(r);
27398 0 : return r;
27399 : }
27400 : }
27401 0 : else if (PyTuple_CheckExact(o)) {
27402 0 : Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
27403 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
27404 0 : PyObject *r = PyTuple_GET_ITEM(o, n);
27405 0 : Py_INCREF(r);
27406 0 : return r;
27407 : }
27408 : } else {
27409 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
27410 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
27411 0 : if (mm && mm->mp_subscript) {
27412 0 : PyObject *r, *key = PyInt_FromSsize_t(i);
27413 0 : if (unlikely(!key)) return NULL;
27414 0 : r = mm->mp_subscript(o, key);
27415 0 : Py_DECREF(key);
27416 0 : return r;
27417 : }
27418 0 : if (likely(sm && sm->sq_item)) {
27419 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
27420 0 : Py_ssize_t l = sm->sq_length(o);
27421 0 : if (likely(l >= 0)) {
27422 0 : i += l;
27423 : } else {
27424 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
27425 : return NULL;
27426 0 : PyErr_Clear();
27427 : }
27428 : }
27429 0 : return sm->sq_item(o, i);
27430 : }
27431 : }
27432 : #else
27433 : if (is_list || !PyMapping_Check(o)) {
27434 : return PySequence_GetItem(o, i);
27435 : }
27436 : #endif
27437 0 : return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
27438 : }
27439 :
27440 : /* PyObjectCallOneArg */
27441 16 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
27442 16 : PyObject *args[2] = {NULL, arg};
27443 16 : return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
27444 : }
27445 :
27446 : /* ObjectGetItem */
27447 : #if CYTHON_USE_TYPE_SLOTS
27448 0 : static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
27449 0 : PyObject *runerr = NULL;
27450 0 : Py_ssize_t key_value;
27451 0 : key_value = __Pyx_PyIndex_AsSsize_t(index);
27452 0 : if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
27453 0 : return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
27454 : }
27455 0 : if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
27456 0 : __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
27457 0 : PyErr_Clear();
27458 0 : PyErr_Format(PyExc_IndexError,
27459 : "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
27460 : __Pyx_DECREF_TypeName(index_type_name);
27461 : }
27462 : return NULL;
27463 : }
27464 0 : static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
27465 0 : __Pyx_TypeName obj_type_name;
27466 0 : if (likely(PyType_Check(obj))) {
27467 0 : PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
27468 0 : if (!meth) {
27469 0 : PyErr_Clear();
27470 : } else {
27471 0 : PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
27472 0 : Py_DECREF(meth);
27473 0 : return result;
27474 : }
27475 : }
27476 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
27477 0 : PyErr_Format(PyExc_TypeError,
27478 : "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
27479 0 : __Pyx_DECREF_TypeName(obj_type_name);
27480 0 : return NULL;
27481 : }
27482 0 : static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
27483 0 : PyTypeObject *tp = Py_TYPE(obj);
27484 0 : PyMappingMethods *mm = tp->tp_as_mapping;
27485 0 : PySequenceMethods *sm = tp->tp_as_sequence;
27486 0 : if (likely(mm && mm->mp_subscript)) {
27487 0 : return mm->mp_subscript(obj, key);
27488 : }
27489 0 : if (likely(sm && sm->sq_item)) {
27490 0 : return __Pyx_PyObject_GetIndex(obj, key);
27491 : }
27492 0 : return __Pyx_PyObject_GetItem_Slow(obj, key);
27493 : }
27494 : #endif
27495 :
27496 : /* KeywordStringCheck */
27497 0 : static int __Pyx_CheckKeywordStrings(
27498 : PyObject *kw,
27499 : const char* function_name,
27500 : int kw_allowed)
27501 : {
27502 0 : PyObject* key = 0;
27503 0 : Py_ssize_t pos = 0;
27504 : #if CYTHON_COMPILING_IN_PYPY
27505 : if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
27506 : goto invalid_keyword;
27507 : return 1;
27508 : #else
27509 0 : if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
27510 0 : Py_ssize_t kwsize;
27511 : #if CYTHON_ASSUME_SAFE_MACROS
27512 0 : kwsize = PyTuple_GET_SIZE(kw);
27513 : #else
27514 : kwsize = PyTuple_Size(kw);
27515 : if (kwsize < 0) return 0;
27516 : #endif
27517 0 : if (unlikely(kwsize == 0))
27518 : return 1;
27519 0 : if (!kw_allowed) {
27520 : #if CYTHON_ASSUME_SAFE_MACROS
27521 0 : key = PyTuple_GET_ITEM(kw, 0);
27522 : #else
27523 : key = PyTuple_GetItem(kw, pos);
27524 : if (!key) return 0;
27525 : #endif
27526 0 : goto invalid_keyword;
27527 : }
27528 : #if PY_VERSION_HEX < 0x03090000
27529 : for (pos = 0; pos < kwsize; pos++) {
27530 : #if CYTHON_ASSUME_SAFE_MACROS
27531 : key = PyTuple_GET_ITEM(kw, pos);
27532 : #else
27533 : key = PyTuple_GetItem(kw, pos);
27534 : if (!key) return 0;
27535 : #endif
27536 : if (unlikely(!PyUnicode_Check(key)))
27537 : goto invalid_keyword_type;
27538 : }
27539 : #endif
27540 : return 1;
27541 : }
27542 0 : while (PyDict_Next(kw, &pos, &key, 0)) {
27543 : #if PY_MAJOR_VERSION < 3
27544 : if (unlikely(!PyString_Check(key)))
27545 : #endif
27546 0 : if (unlikely(!PyUnicode_Check(key)))
27547 0 : goto invalid_keyword_type;
27548 : }
27549 0 : if (!kw_allowed && unlikely(key))
27550 0 : goto invalid_keyword;
27551 : return 1;
27552 0 : invalid_keyword_type:
27553 0 : PyErr_Format(PyExc_TypeError,
27554 : "%.200s() keywords must be strings", function_name);
27555 0 : return 0;
27556 : #endif
27557 0 : invalid_keyword:
27558 : #if PY_MAJOR_VERSION < 3
27559 : PyErr_Format(PyExc_TypeError,
27560 : "%.200s() got an unexpected keyword argument '%.200s'",
27561 : function_name, PyString_AsString(key));
27562 : #else
27563 0 : PyErr_Format(PyExc_TypeError,
27564 : "%s() got an unexpected keyword argument '%U'",
27565 : function_name, key);
27566 : #endif
27567 0 : return 0;
27568 : }
27569 :
27570 : /* DivInt[Py_ssize_t] */
27571 37 : static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
27572 111 : Py_ssize_t q = a / b;
27573 111 : Py_ssize_t r = a - q*b;
27574 74 : q -= ((r != 0) & ((r ^ b) < 0));
27575 37 : return q;
27576 : }
27577 :
27578 : /* GetAttr3 */
27579 : #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
27580 0 : static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
27581 0 : __Pyx_PyThreadState_declare
27582 0 : __Pyx_PyThreadState_assign
27583 0 : if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
27584 : return NULL;
27585 0 : __Pyx_PyErr_Clear();
27586 0 : Py_INCREF(d);
27587 : return d;
27588 : }
27589 : #endif
27590 0 : static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
27591 0 : PyObject *r;
27592 : #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
27593 : int res = PyObject_GetOptionalAttr(o, n, &r);
27594 : return (res != 0) ? r : __Pyx_NewRef(d);
27595 : #else
27596 : #if CYTHON_USE_TYPE_SLOTS
27597 0 : if (likely(PyString_Check(n))) {
27598 0 : r = __Pyx_PyObject_GetAttrStrNoError(o, n);
27599 0 : if (unlikely(!r) && likely(!PyErr_Occurred())) {
27600 0 : r = __Pyx_NewRef(d);
27601 : }
27602 0 : return r;
27603 : }
27604 : #endif
27605 0 : r = PyObject_GetAttr(o, n);
27606 0 : return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
27607 : #endif
27608 : }
27609 :
27610 : /* PyDictVersioning */
27611 : #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
27612 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
27613 : PyObject *dict = Py_TYPE(obj)->tp_dict;
27614 : return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
27615 : }
27616 : static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
27617 : PyObject **dictptr = NULL;
27618 : Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
27619 : if (offset) {
27620 : #if CYTHON_COMPILING_IN_CPYTHON
27621 : dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
27622 : #else
27623 : dictptr = _PyObject_GetDictPtr(obj);
27624 : #endif
27625 : }
27626 : return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
27627 : }
27628 : static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
27629 : PyObject *dict = Py_TYPE(obj)->tp_dict;
27630 : if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
27631 : return 0;
27632 : return obj_dict_version == __Pyx_get_object_dict_version(obj);
27633 : }
27634 : #endif
27635 :
27636 : /* GetModuleGlobalName */
27637 : #if CYTHON_USE_DICT_VERSIONS
27638 : static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
27639 : #else
27640 724 : static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
27641 : #endif
27642 : {
27643 724 : PyObject *result;
27644 : #if !CYTHON_AVOID_BORROWED_REFS
27645 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
27646 724 : result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
27647 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
27648 724 : if (likely(result)) {
27649 1448 : return __Pyx_NewRef(result);
27650 0 : } else if (unlikely(PyErr_Occurred())) {
27651 : return NULL;
27652 : }
27653 : #elif CYTHON_COMPILING_IN_LIMITED_API
27654 : if (unlikely(!__pyx_m)) {
27655 : return NULL;
27656 : }
27657 : result = PyObject_GetAttr(__pyx_m, name);
27658 : if (likely(result)) {
27659 : return result;
27660 : }
27661 : #else
27662 : result = PyDict_GetItem(__pyx_d, name);
27663 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
27664 : if (likely(result)) {
27665 : return __Pyx_NewRef(result);
27666 : }
27667 : #endif
27668 : #else
27669 : result = PyObject_GetItem(__pyx_d, name);
27670 : __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
27671 : if (likely(result)) {
27672 : return __Pyx_NewRef(result);
27673 : }
27674 : PyErr_Clear();
27675 : #endif
27676 0 : return __Pyx_GetBuiltinName(name);
27677 : }
27678 :
27679 : /* RaiseTooManyValuesToUnpack */
27680 0 : static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
27681 0 : PyErr_Format(PyExc_ValueError,
27682 : "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
27683 0 : }
27684 :
27685 : /* RaiseNeedMoreValuesToUnpack */
27686 0 : static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
27687 0 : PyErr_Format(PyExc_ValueError,
27688 : "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
27689 : index, (index == 1) ? "" : "s");
27690 0 : }
27691 :
27692 : /* RaiseNoneIterError */
27693 0 : static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
27694 0 : PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
27695 : }
27696 :
27697 : /* ExtTypeTest */
27698 0 : static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
27699 0 : __Pyx_TypeName obj_type_name;
27700 0 : __Pyx_TypeName type_name;
27701 0 : if (unlikely(!type)) {
27702 0 : PyErr_SetString(PyExc_SystemError, "Missing type object");
27703 0 : return 0;
27704 : }
27705 0 : if (likely(__Pyx_TypeCheck(obj, type)))
27706 : return 1;
27707 0 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
27708 0 : type_name = __Pyx_PyType_GetName(type);
27709 0 : PyErr_Format(PyExc_TypeError,
27710 : "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
27711 : obj_type_name, type_name);
27712 0 : __Pyx_DECREF_TypeName(obj_type_name);
27713 0 : __Pyx_DECREF_TypeName(type_name);
27714 0 : return 0;
27715 : }
27716 :
27717 : /* GetTopmostException */
27718 : #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
27719 : static _PyErr_StackItem *
27720 15 : __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
27721 : {
27722 15 : _PyErr_StackItem *exc_info = tstate->exc_info;
27723 75 : while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
27724 75 : exc_info->previous_item != NULL)
27725 : {
27726 : exc_info = exc_info->previous_item;
27727 : }
27728 15 : return exc_info;
27729 : }
27730 : #endif
27731 :
27732 : /* SaveResetException */
27733 : #if CYTHON_FAST_THREAD_STATE
27734 15 : static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27735 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
27736 15 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
27737 15 : PyObject *exc_value = exc_info->exc_value;
27738 15 : if (exc_value == NULL || exc_value == Py_None) {
27739 15 : *value = NULL;
27740 15 : *type = NULL;
27741 15 : *tb = NULL;
27742 : } else {
27743 0 : *value = exc_value;
27744 0 : Py_INCREF(*value);
27745 0 : *type = (PyObject*) Py_TYPE(exc_value);
27746 0 : Py_INCREF(*type);
27747 0 : *tb = PyException_GetTraceback(exc_value);
27748 : }
27749 : #elif CYTHON_USE_EXC_INFO_STACK
27750 : _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
27751 : *type = exc_info->exc_type;
27752 : *value = exc_info->exc_value;
27753 : *tb = exc_info->exc_traceback;
27754 : Py_XINCREF(*type);
27755 : Py_XINCREF(*value);
27756 : Py_XINCREF(*tb);
27757 : #else
27758 : *type = tstate->exc_type;
27759 : *value = tstate->exc_value;
27760 : *tb = tstate->exc_traceback;
27761 : Py_XINCREF(*type);
27762 : Py_XINCREF(*value);
27763 : Py_XINCREF(*tb);
27764 : #endif
27765 15 : }
27766 0 : static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
27767 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
27768 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
27769 0 : PyObject *tmp_value = exc_info->exc_value;
27770 0 : exc_info->exc_value = value;
27771 0 : Py_XDECREF(tmp_value);
27772 0 : Py_XDECREF(type);
27773 0 : Py_XDECREF(tb);
27774 : #else
27775 : PyObject *tmp_type, *tmp_value, *tmp_tb;
27776 : #if CYTHON_USE_EXC_INFO_STACK
27777 : _PyErr_StackItem *exc_info = tstate->exc_info;
27778 : tmp_type = exc_info->exc_type;
27779 : tmp_value = exc_info->exc_value;
27780 : tmp_tb = exc_info->exc_traceback;
27781 : exc_info->exc_type = type;
27782 : exc_info->exc_value = value;
27783 : exc_info->exc_traceback = tb;
27784 : #else
27785 : tmp_type = tstate->exc_type;
27786 : tmp_value = tstate->exc_value;
27787 : tmp_tb = tstate->exc_traceback;
27788 : tstate->exc_type = type;
27789 : tstate->exc_value = value;
27790 : tstate->exc_traceback = tb;
27791 : #endif
27792 : Py_XDECREF(tmp_type);
27793 : Py_XDECREF(tmp_value);
27794 : Py_XDECREF(tmp_tb);
27795 : #endif
27796 0 : }
27797 : #endif
27798 :
27799 : /* GetException */
27800 : #if CYTHON_FAST_THREAD_STATE
27801 0 : static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
27802 : #else
27803 : static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
27804 : #endif
27805 : {
27806 0 : PyObject *local_type = NULL, *local_value, *local_tb = NULL;
27807 : #if CYTHON_FAST_THREAD_STATE
27808 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
27809 : #if PY_VERSION_HEX >= 0x030C00A6
27810 0 : local_value = tstate->current_exception;
27811 0 : tstate->current_exception = 0;
27812 0 : if (likely(local_value)) {
27813 0 : local_type = (PyObject*) Py_TYPE(local_value);
27814 0 : Py_INCREF(local_type);
27815 0 : local_tb = PyException_GetTraceback(local_value);
27816 : }
27817 : #else
27818 : local_type = tstate->curexc_type;
27819 : local_value = tstate->curexc_value;
27820 : local_tb = tstate->curexc_traceback;
27821 : tstate->curexc_type = 0;
27822 : tstate->curexc_value = 0;
27823 : tstate->curexc_traceback = 0;
27824 : #endif
27825 : #else
27826 : PyErr_Fetch(&local_type, &local_value, &local_tb);
27827 : #endif
27828 0 : PyErr_NormalizeException(&local_type, &local_value, &local_tb);
27829 : #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
27830 0 : if (unlikely(tstate->current_exception))
27831 : #elif CYTHON_FAST_THREAD_STATE
27832 : if (unlikely(tstate->curexc_type))
27833 : #else
27834 : if (unlikely(PyErr_Occurred()))
27835 : #endif
27836 0 : goto bad;
27837 : #if PY_MAJOR_VERSION >= 3
27838 0 : if (local_tb) {
27839 0 : if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
27840 0 : goto bad;
27841 : }
27842 : #endif
27843 0 : Py_XINCREF(local_tb);
27844 0 : Py_XINCREF(local_type);
27845 0 : Py_XINCREF(local_value);
27846 0 : *type = local_type;
27847 0 : *value = local_value;
27848 0 : *tb = local_tb;
27849 : #if CYTHON_FAST_THREAD_STATE
27850 : #if CYTHON_USE_EXC_INFO_STACK
27851 : {
27852 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
27853 : #if PY_VERSION_HEX >= 0x030B00a4
27854 0 : tmp_value = exc_info->exc_value;
27855 0 : exc_info->exc_value = local_value;
27856 0 : tmp_type = NULL;
27857 0 : tmp_tb = NULL;
27858 0 : Py_XDECREF(local_type);
27859 0 : Py_XDECREF(local_tb);
27860 : #else
27861 : tmp_type = exc_info->exc_type;
27862 : tmp_value = exc_info->exc_value;
27863 : tmp_tb = exc_info->exc_traceback;
27864 : exc_info->exc_type = local_type;
27865 : exc_info->exc_value = local_value;
27866 : exc_info->exc_traceback = local_tb;
27867 : #endif
27868 : }
27869 : #else
27870 : tmp_type = tstate->exc_type;
27871 : tmp_value = tstate->exc_value;
27872 : tmp_tb = tstate->exc_traceback;
27873 : tstate->exc_type = local_type;
27874 : tstate->exc_value = local_value;
27875 : tstate->exc_traceback = local_tb;
27876 : #endif
27877 0 : Py_XDECREF(tmp_type);
27878 0 : Py_XDECREF(tmp_value);
27879 0 : Py_XDECREF(tmp_tb);
27880 : #else
27881 : PyErr_SetExcInfo(local_type, local_value, local_tb);
27882 : #endif
27883 0 : return 0;
27884 0 : bad:
27885 0 : *type = 0;
27886 0 : *value = 0;
27887 0 : *tb = 0;
27888 0 : Py_XDECREF(local_type);
27889 0 : Py_XDECREF(local_value);
27890 0 : Py_XDECREF(local_tb);
27891 0 : return -1;
27892 : }
27893 :
27894 : /* SwapException */
27895 : #if CYTHON_FAST_THREAD_STATE
27896 0 : static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
27897 0 : PyObject *tmp_type, *tmp_value, *tmp_tb;
27898 : #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
27899 0 : _PyErr_StackItem *exc_info = tstate->exc_info;
27900 0 : tmp_value = exc_info->exc_value;
27901 0 : exc_info->exc_value = *value;
27902 0 : if (tmp_value == NULL || tmp_value == Py_None) {
27903 0 : Py_XDECREF(tmp_value);
27904 0 : tmp_value = NULL;
27905 0 : tmp_type = NULL;
27906 0 : tmp_tb = NULL;
27907 : } else {
27908 0 : tmp_type = (PyObject*) Py_TYPE(tmp_value);
27909 0 : Py_INCREF(tmp_type);
27910 : #if CYTHON_COMPILING_IN_CPYTHON
27911 0 : tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
27912 0 : Py_XINCREF(tmp_tb);
27913 : #else
27914 : tmp_tb = PyException_GetTraceback(tmp_value);
27915 : #endif
27916 : }
27917 : #elif CYTHON_USE_EXC_INFO_STACK
27918 : _PyErr_StackItem *exc_info = tstate->exc_info;
27919 : tmp_type = exc_info->exc_type;
27920 : tmp_value = exc_info->exc_value;
27921 : tmp_tb = exc_info->exc_traceback;
27922 : exc_info->exc_type = *type;
27923 : exc_info->exc_value = *value;
27924 : exc_info->exc_traceback = *tb;
27925 : #else
27926 : tmp_type = tstate->exc_type;
27927 : tmp_value = tstate->exc_value;
27928 : tmp_tb = tstate->exc_traceback;
27929 : tstate->exc_type = *type;
27930 : tstate->exc_value = *value;
27931 : tstate->exc_traceback = *tb;
27932 : #endif
27933 0 : *type = tmp_type;
27934 0 : *value = tmp_value;
27935 0 : *tb = tmp_tb;
27936 0 : }
27937 : #else
27938 : static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
27939 : PyObject *tmp_type, *tmp_value, *tmp_tb;
27940 : PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
27941 : PyErr_SetExcInfo(*type, *value, *tb);
27942 : *type = tmp_type;
27943 : *value = tmp_value;
27944 : *tb = tmp_tb;
27945 : }
27946 : #endif
27947 :
27948 : /* Import */
27949 0 : static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
27950 0 : PyObject *module = 0;
27951 0 : PyObject *empty_dict = 0;
27952 0 : PyObject *empty_list = 0;
27953 : #if PY_MAJOR_VERSION < 3
27954 : PyObject *py_import;
27955 : py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
27956 : if (unlikely(!py_import))
27957 : goto bad;
27958 : if (!from_list) {
27959 : empty_list = PyList_New(0);
27960 : if (unlikely(!empty_list))
27961 : goto bad;
27962 : from_list = empty_list;
27963 : }
27964 : #endif
27965 0 : empty_dict = PyDict_New();
27966 0 : if (unlikely(!empty_dict))
27967 0 : goto bad;
27968 : {
27969 : #if PY_MAJOR_VERSION >= 3
27970 0 : if (level == -1) {
27971 0 : if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
27972 0 : module = PyImport_ImportModuleLevelObject(
27973 0 : name, __pyx_d, empty_dict, from_list, 1);
27974 0 : if (unlikely(!module)) {
27975 0 : if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
27976 0 : goto bad;
27977 0 : PyErr_Clear();
27978 : }
27979 : }
27980 0 : level = 0;
27981 : }
27982 : #endif
27983 0 : if (!module) {
27984 : #if PY_MAJOR_VERSION < 3
27985 : PyObject *py_level = PyInt_FromLong(level);
27986 : if (unlikely(!py_level))
27987 : goto bad;
27988 : module = PyObject_CallFunctionObjArgs(py_import,
27989 : name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
27990 : Py_DECREF(py_level);
27991 : #else
27992 0 : module = PyImport_ImportModuleLevelObject(
27993 0 : name, __pyx_d, empty_dict, from_list, level);
27994 : #endif
27995 : }
27996 : }
27997 0 : bad:
27998 0 : Py_XDECREF(empty_dict);
27999 0 : Py_XDECREF(empty_list);
28000 : #if PY_MAJOR_VERSION < 3
28001 : Py_XDECREF(py_import);
28002 : #endif
28003 0 : return module;
28004 : }
28005 :
28006 : /* ImportDottedModule */
28007 : #if PY_MAJOR_VERSION >= 3
28008 0 : static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
28009 0 : PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
28010 0 : if (unlikely(PyErr_Occurred())) {
28011 0 : PyErr_Clear();
28012 : }
28013 0 : if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
28014 : partial_name = name;
28015 : } else {
28016 0 : slice = PySequence_GetSlice(parts_tuple, 0, count);
28017 0 : if (unlikely(!slice))
28018 0 : goto bad;
28019 0 : sep = PyUnicode_FromStringAndSize(".", 1);
28020 0 : if (unlikely(!sep))
28021 0 : goto bad;
28022 0 : partial_name = PyUnicode_Join(sep, slice);
28023 : }
28024 0 : PyErr_Format(
28025 : #if PY_MAJOR_VERSION < 3
28026 : PyExc_ImportError,
28027 : "No module named '%s'", PyString_AS_STRING(partial_name));
28028 : #else
28029 : #if PY_VERSION_HEX >= 0x030600B1
28030 : PyExc_ModuleNotFoundError,
28031 : #else
28032 : PyExc_ImportError,
28033 : #endif
28034 : "No module named '%U'", partial_name);
28035 : #endif
28036 0 : bad:
28037 0 : Py_XDECREF(sep);
28038 0 : Py_XDECREF(slice);
28039 0 : Py_XDECREF(partial_name);
28040 0 : return NULL;
28041 : }
28042 : #endif
28043 : #if PY_MAJOR_VERSION >= 3
28044 6 : static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
28045 6 : PyObject *imported_module;
28046 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
28047 : PyObject *modules = PyImport_GetModuleDict();
28048 : if (unlikely(!modules))
28049 : return NULL;
28050 : imported_module = __Pyx_PyDict_GetItemStr(modules, name);
28051 : Py_XINCREF(imported_module);
28052 : #else
28053 12 : imported_module = PyImport_GetModule(name);
28054 : #endif
28055 6 : return imported_module;
28056 : }
28057 : #endif
28058 : #if PY_MAJOR_VERSION >= 3
28059 0 : static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
28060 0 : Py_ssize_t i, nparts;
28061 0 : nparts = PyTuple_GET_SIZE(parts_tuple);
28062 0 : for (i=1; i < nparts && module; i++) {
28063 0 : PyObject *part, *submodule;
28064 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
28065 0 : part = PyTuple_GET_ITEM(parts_tuple, i);
28066 : #else
28067 : part = PySequence_ITEM(parts_tuple, i);
28068 : #endif
28069 0 : submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
28070 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
28071 : Py_DECREF(part);
28072 : #endif
28073 0 : Py_DECREF(module);
28074 0 : module = submodule;
28075 : }
28076 0 : if (unlikely(!module)) {
28077 0 : return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
28078 : }
28079 : return module;
28080 : }
28081 : #endif
28082 0 : static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
28083 : #if PY_MAJOR_VERSION < 3
28084 : PyObject *module, *from_list, *star = __pyx_n_s__3;
28085 : CYTHON_UNUSED_VAR(parts_tuple);
28086 : from_list = PyList_New(1);
28087 : if (unlikely(!from_list))
28088 : return NULL;
28089 : Py_INCREF(star);
28090 : PyList_SET_ITEM(from_list, 0, star);
28091 : module = __Pyx_Import(name, from_list, 0);
28092 : Py_DECREF(from_list);
28093 : return module;
28094 : #else
28095 0 : PyObject *imported_module;
28096 0 : PyObject *module = __Pyx_Import(name, NULL, 0);
28097 0 : if (!parts_tuple || unlikely(!module))
28098 : return module;
28099 0 : imported_module = __Pyx__ImportDottedModule_Lookup(name);
28100 0 : if (likely(imported_module)) {
28101 0 : Py_DECREF(module);
28102 0 : return imported_module;
28103 : }
28104 0 : PyErr_Clear();
28105 0 : return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
28106 : #endif
28107 : }
28108 6 : static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
28109 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
28110 6 : PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
28111 6 : if (likely(module)) {
28112 6 : PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
28113 6 : if (likely(spec)) {
28114 6 : PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
28115 6 : if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
28116 6 : Py_DECREF(spec);
28117 : spec = NULL;
28118 : }
28119 6 : Py_XDECREF(unsafe);
28120 : }
28121 6 : if (likely(!spec)) {
28122 6 : PyErr_Clear();
28123 6 : return module;
28124 : }
28125 0 : Py_DECREF(spec);
28126 0 : Py_DECREF(module);
28127 0 : } else if (PyErr_Occurred()) {
28128 0 : PyErr_Clear();
28129 : }
28130 : #endif
28131 0 : return __Pyx__ImportDottedModule(name, parts_tuple);
28132 : }
28133 :
28134 : /* FastTypeChecks */
28135 : #if CYTHON_COMPILING_IN_CPYTHON
28136 : static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
28137 0 : while (a) {
28138 0 : a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
28139 0 : if (a == b)
28140 : return 1;
28141 : }
28142 0 : return b == &PyBaseObject_Type;
28143 : }
28144 636 : static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
28145 636 : PyObject *mro;
28146 636 : if (a == b) return 1;
28147 636 : mro = a->tp_mro;
28148 636 : if (likely(mro)) {
28149 636 : Py_ssize_t i, n;
28150 636 : n = PyTuple_GET_SIZE(mro);
28151 1908 : for (i = 0; i < n; i++) {
28152 1272 : if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
28153 : return 1;
28154 : }
28155 : return 0;
28156 : }
28157 636 : return __Pyx_InBases(a, b);
28158 : }
28159 30 : static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
28160 30 : PyObject *mro;
28161 30 : if (cls == a || cls == b) return 1;
28162 20 : mro = cls->tp_mro;
28163 20 : if (likely(mro)) {
28164 20 : Py_ssize_t i, n;
28165 20 : n = PyTuple_GET_SIZE(mro);
28166 60 : for (i = 0; i < n; i++) {
28167 40 : PyObject *base = PyTuple_GET_ITEM(mro, i);
28168 40 : if (base == (PyObject *)a || base == (PyObject *)b)
28169 : return 1;
28170 : }
28171 : return 0;
28172 : }
28173 0 : return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
28174 : }
28175 : #if PY_MAJOR_VERSION == 2
28176 : static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
28177 : PyObject *exception, *value, *tb;
28178 : int res;
28179 : __Pyx_PyThreadState_declare
28180 : __Pyx_PyThreadState_assign
28181 : __Pyx_ErrFetch(&exception, &value, &tb);
28182 : res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
28183 : if (unlikely(res == -1)) {
28184 : PyErr_WriteUnraisable(err);
28185 : res = 0;
28186 : }
28187 : if (!res) {
28188 : res = PyObject_IsSubclass(err, exc_type2);
28189 : if (unlikely(res == -1)) {
28190 : PyErr_WriteUnraisable(err);
28191 : res = 0;
28192 : }
28193 : }
28194 : __Pyx_ErrRestore(exception, value, tb);
28195 : return res;
28196 : }
28197 : #else
28198 0 : static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
28199 0 : if (exc_type1) {
28200 : return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
28201 : } else {
28202 0 : return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
28203 : }
28204 : }
28205 : #endif
28206 0 : static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
28207 0 : Py_ssize_t i, n;
28208 0 : assert(PyExceptionClass_Check(exc_type));
28209 0 : n = PyTuple_GET_SIZE(tuple);
28210 : #if PY_MAJOR_VERSION >= 3
28211 0 : for (i=0; i<n; i++) {
28212 0 : if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
28213 : }
28214 : #endif
28215 0 : for (i=0; i<n; i++) {
28216 0 : PyObject *t = PyTuple_GET_ITEM(tuple, i);
28217 : #if PY_MAJOR_VERSION < 3
28218 : if (likely(exc_type == t)) return 1;
28219 : #endif
28220 0 : if (likely(PyExceptionClass_Check(t))) {
28221 0 : if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
28222 : } else {
28223 0 : }
28224 : }
28225 : return 0;
28226 : }
28227 0 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
28228 0 : if (likely(err == exc_type)) return 1;
28229 0 : if (likely(PyExceptionClass_Check(err))) {
28230 0 : if (likely(PyExceptionClass_Check(exc_type))) {
28231 0 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
28232 0 : } else if (likely(PyTuple_Check(exc_type))) {
28233 0 : return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
28234 : } else {
28235 0 : }
28236 : }
28237 0 : return PyErr_GivenExceptionMatches(err, exc_type);
28238 : }
28239 : static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
28240 : assert(PyExceptionClass_Check(exc_type1));
28241 : assert(PyExceptionClass_Check(exc_type2));
28242 : if (likely(err == exc_type1 || err == exc_type2)) return 1;
28243 : if (likely(PyExceptionClass_Check(err))) {
28244 : return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
28245 : }
28246 : return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
28247 : }
28248 : #endif
28249 :
28250 : /* PySequenceMultiply */
28251 0 : static PyObject* __Pyx_PySequence_Multiply_Generic(PyObject *seq, Py_ssize_t mul) {
28252 0 : PyObject *result, *pymul = PyInt_FromSsize_t(mul);
28253 0 : if (unlikely(!pymul))
28254 : return NULL;
28255 0 : result = PyNumber_Multiply(seq, pymul);
28256 0 : Py_DECREF(pymul);
28257 : return result;
28258 : }
28259 0 : static CYTHON_INLINE PyObject* __Pyx_PySequence_Multiply(PyObject *seq, Py_ssize_t mul) {
28260 : #if CYTHON_USE_TYPE_SLOTS
28261 0 : PyTypeObject *type = Py_TYPE(seq);
28262 0 : if (likely(type->tp_as_sequence && type->tp_as_sequence->sq_repeat)) {
28263 0 : return type->tp_as_sequence->sq_repeat(seq, mul);
28264 : } else
28265 : #endif
28266 : {
28267 0 : return __Pyx_PySequence_Multiply_Generic(seq, mul);
28268 : }
28269 : }
28270 :
28271 : /* SetItemInt */
28272 0 : static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
28273 0 : int r;
28274 0 : if (unlikely(!j)) return -1;
28275 0 : r = PyObject_SetItem(o, j, v);
28276 0 : Py_DECREF(j);
28277 : return r;
28278 : }
28279 0 : static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
28280 : CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
28281 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
28282 0 : if (is_list || PyList_CheckExact(o)) {
28283 0 : Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
28284 0 : if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
28285 0 : PyObject* old = PyList_GET_ITEM(o, n);
28286 0 : Py_INCREF(v);
28287 0 : PyList_SET_ITEM(o, n, v);
28288 0 : Py_DECREF(old);
28289 0 : return 1;
28290 : }
28291 : } else {
28292 0 : PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
28293 0 : PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
28294 0 : if (mm && mm->mp_ass_subscript) {
28295 0 : int r;
28296 0 : PyObject *key = PyInt_FromSsize_t(i);
28297 0 : if (unlikely(!key)) return -1;
28298 0 : r = mm->mp_ass_subscript(o, key, v);
28299 0 : Py_DECREF(key);
28300 0 : return r;
28301 : }
28302 0 : if (likely(sm && sm->sq_ass_item)) {
28303 0 : if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
28304 0 : Py_ssize_t l = sm->sq_length(o);
28305 0 : if (likely(l >= 0)) {
28306 0 : i += l;
28307 : } else {
28308 0 : if (!PyErr_ExceptionMatches(PyExc_OverflowError))
28309 : return -1;
28310 0 : PyErr_Clear();
28311 : }
28312 : }
28313 0 : return sm->sq_ass_item(o, i, v);
28314 : }
28315 : }
28316 : #else
28317 : if (is_list || !PyMapping_Check(o))
28318 : {
28319 : return PySequence_SetItem(o, i, v);
28320 : }
28321 : #endif
28322 0 : return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
28323 : }
28324 :
28325 : /* RaiseUnboundLocalError */
28326 0 : static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
28327 0 : PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
28328 : }
28329 :
28330 : /* DivInt[long] */
28331 0 : static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
28332 0 : long q = a / b;
28333 0 : long r = a - q*b;
28334 0 : q -= ((r != 0) & ((r ^ b) < 0));
28335 0 : return q;
28336 : }
28337 :
28338 : /* ImportFrom */
28339 0 : static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
28340 0 : PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
28341 0 : if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
28342 0 : const char* module_name_str = 0;
28343 0 : PyObject* module_name = 0;
28344 0 : PyObject* module_dot = 0;
28345 0 : PyObject* full_name = 0;
28346 0 : PyErr_Clear();
28347 0 : module_name_str = PyModule_GetName(module);
28348 0 : if (unlikely(!module_name_str)) { goto modbad; }
28349 0 : module_name = PyUnicode_FromString(module_name_str);
28350 0 : if (unlikely(!module_name)) { goto modbad; }
28351 0 : module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__2);
28352 0 : if (unlikely(!module_dot)) { goto modbad; }
28353 0 : full_name = PyUnicode_Concat(module_dot, name);
28354 0 : if (unlikely(!full_name)) { goto modbad; }
28355 : #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
28356 : {
28357 : PyObject *modules = PyImport_GetModuleDict();
28358 : if (unlikely(!modules))
28359 : goto modbad;
28360 : value = PyObject_GetItem(modules, full_name);
28361 : }
28362 : #else
28363 0 : value = PyImport_GetModule(full_name);
28364 : #endif
28365 0 : modbad:
28366 0 : Py_XDECREF(full_name);
28367 0 : Py_XDECREF(module_dot);
28368 0 : Py_XDECREF(module_name);
28369 : }
28370 0 : if (unlikely(!value)) {
28371 0 : PyErr_Format(PyExc_ImportError,
28372 : #if PY_MAJOR_VERSION < 3
28373 : "cannot import name %.230s", PyString_AS_STRING(name));
28374 : #else
28375 : "cannot import name %S", name);
28376 : #endif
28377 : }
28378 0 : return value;
28379 : }
28380 :
28381 : /* HasAttr */
28382 0 : static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
28383 0 : PyObject *r;
28384 0 : if (unlikely(!__Pyx_PyBaseString_Check(n))) {
28385 0 : PyErr_SetString(PyExc_TypeError,
28386 : "hasattr(): attribute name must be string");
28387 0 : return -1;
28388 : }
28389 0 : r = __Pyx_GetAttr(o, n);
28390 0 : if (!r) {
28391 0 : PyErr_Clear();
28392 0 : return 0;
28393 : } else {
28394 0 : Py_DECREF(r);
28395 0 : return 1;
28396 : }
28397 : }
28398 :
28399 : /* DivInt[__pyx_t_5numpy_intp_t] */
28400 153 : static CYTHON_INLINE __pyx_t_5numpy_intp_t __Pyx_div___pyx_t_5numpy_intp_t(__pyx_t_5numpy_intp_t a, __pyx_t_5numpy_intp_t b) {
28401 153 : __pyx_t_5numpy_intp_t q = a / b;
28402 153 : __pyx_t_5numpy_intp_t r = a - q*b;
28403 153 : q -= ((r != 0) & ((r ^ b) < 0));
28404 153 : return q;
28405 : }
28406 :
28407 : /* PyObject_GenericGetAttrNoDict */
28408 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
28409 : static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
28410 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
28411 : PyErr_Format(PyExc_AttributeError,
28412 : #if PY_MAJOR_VERSION >= 3
28413 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
28414 : type_name, attr_name);
28415 : #else
28416 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
28417 : type_name, PyString_AS_STRING(attr_name));
28418 : #endif
28419 : __Pyx_DECREF_TypeName(type_name);
28420 : return NULL;
28421 : }
28422 : static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
28423 : PyObject *descr;
28424 : PyTypeObject *tp = Py_TYPE(obj);
28425 : if (unlikely(!PyString_Check(attr_name))) {
28426 : return PyObject_GenericGetAttr(obj, attr_name);
28427 : }
28428 : assert(!tp->tp_dictoffset);
28429 : descr = _PyType_Lookup(tp, attr_name);
28430 : if (unlikely(!descr)) {
28431 : return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
28432 : }
28433 : Py_INCREF(descr);
28434 : #if PY_MAJOR_VERSION < 3
28435 : if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
28436 : #endif
28437 : {
28438 : descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
28439 : if (unlikely(f)) {
28440 : PyObject *res = f(descr, obj, (PyObject *)tp);
28441 : Py_DECREF(descr);
28442 : return res;
28443 : }
28444 : }
28445 : return descr;
28446 : }
28447 : #endif
28448 :
28449 : /* PyObject_GenericGetAttr */
28450 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
28451 : static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
28452 : if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
28453 : return PyObject_GenericGetAttr(obj, attr_name);
28454 : }
28455 : return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
28456 : }
28457 : #endif
28458 :
28459 : /* FixUpExtensionType */
28460 : #if CYTHON_USE_TYPE_SPECS
28461 : static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
28462 : #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
28463 : CYTHON_UNUSED_VAR(spec);
28464 : CYTHON_UNUSED_VAR(type);
28465 : #else
28466 : const PyType_Slot *slot = spec->slots;
28467 : while (slot && slot->slot && slot->slot != Py_tp_members)
28468 : slot++;
28469 : if (slot && slot->slot == Py_tp_members) {
28470 : int changed = 0;
28471 : #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
28472 : const
28473 : #endif
28474 : PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
28475 : while (memb && memb->name) {
28476 : if (memb->name[0] == '_' && memb->name[1] == '_') {
28477 : #if PY_VERSION_HEX < 0x030900b1
28478 : if (strcmp(memb->name, "__weaklistoffset__") == 0) {
28479 : assert(memb->type == T_PYSSIZET);
28480 : assert(memb->flags == READONLY);
28481 : type->tp_weaklistoffset = memb->offset;
28482 : changed = 1;
28483 : }
28484 : else if (strcmp(memb->name, "__dictoffset__") == 0) {
28485 : assert(memb->type == T_PYSSIZET);
28486 : assert(memb->flags == READONLY);
28487 : type->tp_dictoffset = memb->offset;
28488 : changed = 1;
28489 : }
28490 : #if CYTHON_METH_FASTCALL
28491 : else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
28492 : assert(memb->type == T_PYSSIZET);
28493 : assert(memb->flags == READONLY);
28494 : #if PY_VERSION_HEX >= 0x030800b4
28495 : type->tp_vectorcall_offset = memb->offset;
28496 : #else
28497 : type->tp_print = (printfunc) memb->offset;
28498 : #endif
28499 : changed = 1;
28500 : }
28501 : #endif
28502 : #else
28503 : if ((0));
28504 : #endif
28505 : #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
28506 : else if (strcmp(memb->name, "__module__") == 0) {
28507 : PyObject *descr;
28508 : assert(memb->type == T_OBJECT);
28509 : assert(memb->flags == 0 || memb->flags == READONLY);
28510 : descr = PyDescr_NewMember(type, memb);
28511 : if (unlikely(!descr))
28512 : return -1;
28513 : if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
28514 : Py_DECREF(descr);
28515 : return -1;
28516 : }
28517 : Py_DECREF(descr);
28518 : changed = 1;
28519 : }
28520 : #endif
28521 : }
28522 : memb++;
28523 : }
28524 : if (changed)
28525 : PyType_Modified(type);
28526 : }
28527 : #endif
28528 : return 0;
28529 : }
28530 : #endif
28531 :
28532 : /* PyObjectCallNoArg */
28533 : static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
28534 : PyObject *arg[2] = {NULL, NULL};
28535 : return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
28536 : }
28537 :
28538 : /* PyObjectGetMethod */
28539 : static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
28540 : PyObject *attr;
28541 : #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
28542 : __Pyx_TypeName type_name;
28543 : PyTypeObject *tp = Py_TYPE(obj);
28544 : PyObject *descr;
28545 : descrgetfunc f = NULL;
28546 : PyObject **dictptr, *dict;
28547 : int meth_found = 0;
28548 : assert (*method == NULL);
28549 : if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
28550 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
28551 : goto try_unpack;
28552 : }
28553 : if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
28554 : return 0;
28555 : }
28556 : descr = _PyType_Lookup(tp, name);
28557 : if (likely(descr != NULL)) {
28558 : Py_INCREF(descr);
28559 : #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
28560 : if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
28561 : #elif PY_MAJOR_VERSION >= 3
28562 : #ifdef __Pyx_CyFunction_USED
28563 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
28564 : #else
28565 : if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
28566 : #endif
28567 : #else
28568 : #ifdef __Pyx_CyFunction_USED
28569 : if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
28570 : #else
28571 : if (likely(PyFunction_Check(descr)))
28572 : #endif
28573 : #endif
28574 : {
28575 : meth_found = 1;
28576 : } else {
28577 : f = Py_TYPE(descr)->tp_descr_get;
28578 : if (f != NULL && PyDescr_IsData(descr)) {
28579 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
28580 : Py_DECREF(descr);
28581 : goto try_unpack;
28582 : }
28583 : }
28584 : }
28585 : dictptr = _PyObject_GetDictPtr(obj);
28586 : if (dictptr != NULL && (dict = *dictptr) != NULL) {
28587 : Py_INCREF(dict);
28588 : attr = __Pyx_PyDict_GetItemStr(dict, name);
28589 : if (attr != NULL) {
28590 : Py_INCREF(attr);
28591 : Py_DECREF(dict);
28592 : Py_XDECREF(descr);
28593 : goto try_unpack;
28594 : }
28595 : Py_DECREF(dict);
28596 : }
28597 : if (meth_found) {
28598 : *method = descr;
28599 : return 1;
28600 : }
28601 : if (f != NULL) {
28602 : attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
28603 : Py_DECREF(descr);
28604 : goto try_unpack;
28605 : }
28606 : if (likely(descr != NULL)) {
28607 : *method = descr;
28608 : return 0;
28609 : }
28610 : type_name = __Pyx_PyType_GetName(tp);
28611 : PyErr_Format(PyExc_AttributeError,
28612 : #if PY_MAJOR_VERSION >= 3
28613 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
28614 : type_name, name);
28615 : #else
28616 : "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
28617 : type_name, PyString_AS_STRING(name));
28618 : #endif
28619 : __Pyx_DECREF_TypeName(type_name);
28620 : return 0;
28621 : #else
28622 : attr = __Pyx_PyObject_GetAttrStr(obj, name);
28623 : goto try_unpack;
28624 : #endif
28625 : try_unpack:
28626 : #if CYTHON_UNPACK_METHODS
28627 : if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
28628 : PyObject *function = PyMethod_GET_FUNCTION(attr);
28629 : Py_INCREF(function);
28630 : Py_DECREF(attr);
28631 : *method = function;
28632 : return 1;
28633 : }
28634 : #endif
28635 : *method = attr;
28636 : return 0;
28637 : }
28638 :
28639 : /* PyObjectCallMethod0 */
28640 : static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
28641 : PyObject *method = NULL, *result = NULL;
28642 : int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
28643 : if (likely(is_method)) {
28644 : result = __Pyx_PyObject_CallOneArg(method, obj);
28645 : Py_DECREF(method);
28646 : return result;
28647 : }
28648 : if (unlikely(!method)) goto bad;
28649 : result = __Pyx_PyObject_CallNoArg(method);
28650 : Py_DECREF(method);
28651 : bad:
28652 : return result;
28653 : }
28654 :
28655 : /* ValidateBasesTuple */
28656 : #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
28657 0 : static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
28658 0 : Py_ssize_t i, n;
28659 : #if CYTHON_ASSUME_SAFE_MACROS
28660 0 : n = PyTuple_GET_SIZE(bases);
28661 : #else
28662 : n = PyTuple_Size(bases);
28663 : if (n < 0) return -1;
28664 : #endif
28665 0 : for (i = 1; i < n; i++)
28666 : {
28667 : #if CYTHON_AVOID_BORROWED_REFS
28668 : PyObject *b0 = PySequence_GetItem(bases, i);
28669 : if (!b0) return -1;
28670 : #elif CYTHON_ASSUME_SAFE_MACROS
28671 0 : PyObject *b0 = PyTuple_GET_ITEM(bases, i);
28672 : #else
28673 : PyObject *b0 = PyTuple_GetItem(bases, i);
28674 : if (!b0) return -1;
28675 : #endif
28676 0 : PyTypeObject *b;
28677 : #if PY_MAJOR_VERSION < 3
28678 : if (PyClass_Check(b0))
28679 : {
28680 : PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
28681 : PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
28682 : #if CYTHON_AVOID_BORROWED_REFS
28683 : Py_DECREF(b0);
28684 : #endif
28685 : return -1;
28686 : }
28687 : #endif
28688 0 : b = (PyTypeObject*) b0;
28689 0 : if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
28690 : {
28691 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
28692 0 : PyErr_Format(PyExc_TypeError,
28693 : "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
28694 0 : __Pyx_DECREF_TypeName(b_name);
28695 : #if CYTHON_AVOID_BORROWED_REFS
28696 : Py_DECREF(b0);
28697 : #endif
28698 0 : return -1;
28699 : }
28700 0 : if (dictoffset == 0)
28701 : {
28702 0 : Py_ssize_t b_dictoffset = 0;
28703 : #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
28704 0 : b_dictoffset = b->tp_dictoffset;
28705 : #else
28706 : PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
28707 : if (!py_b_dictoffset) goto dictoffset_return;
28708 : b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
28709 : Py_DECREF(py_b_dictoffset);
28710 : if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
28711 : #endif
28712 0 : if (b_dictoffset) {
28713 : {
28714 0 : __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
28715 0 : PyErr_Format(PyExc_TypeError,
28716 : "extension type '%.200s' has no __dict__ slot, "
28717 : "but base type '" __Pyx_FMT_TYPENAME "' has: "
28718 : "either add 'cdef dict __dict__' to the extension type "
28719 : "or add '__slots__ = [...]' to the base type",
28720 : type_name, b_name);
28721 0 : __Pyx_DECREF_TypeName(b_name);
28722 : }
28723 : #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
28724 : dictoffset_return:
28725 : #endif
28726 : #if CYTHON_AVOID_BORROWED_REFS
28727 : Py_DECREF(b0);
28728 : #endif
28729 0 : return -1;
28730 : }
28731 : }
28732 : #if CYTHON_AVOID_BORROWED_REFS
28733 : Py_DECREF(b0);
28734 : #endif
28735 : }
28736 : return 0;
28737 : }
28738 : #endif
28739 :
28740 : /* PyType_Ready */
28741 12 : static int __Pyx_PyType_Ready(PyTypeObject *t) {
28742 : #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
28743 : (void)__Pyx_PyObject_CallMethod0;
28744 : #if CYTHON_USE_TYPE_SPECS
28745 : (void)__Pyx_validate_bases_tuple;
28746 : #endif
28747 : return PyType_Ready(t);
28748 : #else
28749 12 : int r;
28750 12 : PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
28751 12 : if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
28752 : return -1;
28753 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
28754 : {
28755 12 : int gc_was_enabled;
28756 : #if PY_VERSION_HEX >= 0x030A00b1
28757 12 : gc_was_enabled = PyGC_Disable();
28758 12 : (void)__Pyx_PyObject_CallMethod0;
28759 : #else
28760 : PyObject *ret, *py_status;
28761 : PyObject *gc = NULL;
28762 : #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
28763 : gc = PyImport_GetModule(__pyx_kp_u_gc);
28764 : #endif
28765 : if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
28766 : if (unlikely(!gc)) return -1;
28767 : py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
28768 : if (unlikely(!py_status)) {
28769 : Py_DECREF(gc);
28770 : return -1;
28771 : }
28772 : gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
28773 : Py_DECREF(py_status);
28774 : if (gc_was_enabled > 0) {
28775 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
28776 : if (unlikely(!ret)) {
28777 : Py_DECREF(gc);
28778 : return -1;
28779 : }
28780 : Py_DECREF(ret);
28781 : } else if (unlikely(gc_was_enabled == -1)) {
28782 : Py_DECREF(gc);
28783 : return -1;
28784 : }
28785 : #endif
28786 12 : t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
28787 : #if PY_VERSION_HEX >= 0x030A0000
28788 12 : t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
28789 : #endif
28790 : #else
28791 : (void)__Pyx_PyObject_CallMethod0;
28792 : #endif
28793 12 : r = PyType_Ready(t);
28794 : #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
28795 12 : t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
28796 : #if PY_VERSION_HEX >= 0x030A00b1
28797 12 : if (gc_was_enabled)
28798 12 : PyGC_Enable();
28799 : #else
28800 : if (gc_was_enabled) {
28801 : PyObject *tp, *v, *tb;
28802 : PyErr_Fetch(&tp, &v, &tb);
28803 : ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
28804 : if (likely(ret || r == -1)) {
28805 : Py_XDECREF(ret);
28806 : PyErr_Restore(tp, v, tb);
28807 : } else {
28808 : Py_XDECREF(tp);
28809 : Py_XDECREF(v);
28810 : Py_XDECREF(tb);
28811 : r = -1;
28812 : }
28813 : }
28814 : Py_DECREF(gc);
28815 : #endif
28816 : }
28817 : #endif
28818 : return r;
28819 : #endif
28820 : }
28821 :
28822 : /* SetVTable */
28823 9 : static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
28824 9 : PyObject *ob = PyCapsule_New(vtable, 0, 0);
28825 9 : if (unlikely(!ob))
28826 0 : goto bad;
28827 : #if CYTHON_COMPILING_IN_LIMITED_API
28828 : if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
28829 : #else
28830 9 : if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
28831 : #endif
28832 0 : goto bad;
28833 9 : Py_DECREF(ob);
28834 : return 0;
28835 0 : bad:
28836 0 : Py_XDECREF(ob);
28837 0 : return -1;
28838 : }
28839 :
28840 : /* GetVTable */
28841 0 : static void* __Pyx_GetVtable(PyTypeObject *type) {
28842 0 : void* ptr;
28843 : #if CYTHON_COMPILING_IN_LIMITED_API
28844 : PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
28845 : #else
28846 0 : PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
28847 : #endif
28848 0 : if (!ob)
28849 0 : goto bad;
28850 0 : ptr = PyCapsule_GetPointer(ob, 0);
28851 0 : if (!ptr && !PyErr_Occurred())
28852 0 : PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
28853 0 : Py_DECREF(ob);
28854 : return ptr;
28855 0 : bad:
28856 0 : Py_XDECREF(ob);
28857 0 : return NULL;
28858 : }
28859 :
28860 : /* MergeVTables */
28861 : #if !CYTHON_COMPILING_IN_LIMITED_API
28862 9 : static int __Pyx_MergeVtables(PyTypeObject *type) {
28863 9 : int i;
28864 9 : void** base_vtables;
28865 9 : __Pyx_TypeName tp_base_name;
28866 9 : __Pyx_TypeName base_name;
28867 9 : void* unknown = (void*)-1;
28868 9 : PyObject* bases = type->tp_bases;
28869 9 : int base_depth = 0;
28870 : {
28871 9 : PyTypeObject* base = type->tp_base;
28872 21 : while (base) {
28873 12 : base_depth += 1;
28874 12 : base = base->tp_base;
28875 : }
28876 : }
28877 9 : base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
28878 9 : base_vtables[0] = unknown;
28879 9 : for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
28880 0 : void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
28881 0 : if (base_vtable != NULL) {
28882 0 : int j;
28883 0 : PyTypeObject* base = type->tp_base;
28884 0 : for (j = 0; j < base_depth; j++) {
28885 0 : if (base_vtables[j] == unknown) {
28886 0 : base_vtables[j] = __Pyx_GetVtable(base);
28887 0 : base_vtables[j + 1] = unknown;
28888 : }
28889 0 : if (base_vtables[j] == base_vtable) {
28890 : break;
28891 0 : } else if (base_vtables[j] == NULL) {
28892 0 : goto bad;
28893 : }
28894 0 : base = base->tp_base;
28895 : }
28896 : }
28897 : }
28898 9 : PyErr_Clear();
28899 9 : free(base_vtables);
28900 9 : return 0;
28901 0 : bad:
28902 0 : tp_base_name = __Pyx_PyType_GetName(type->tp_base);
28903 0 : base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
28904 0 : PyErr_Format(PyExc_TypeError,
28905 : "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
28906 0 : __Pyx_DECREF_TypeName(tp_base_name);
28907 0 : __Pyx_DECREF_TypeName(base_name);
28908 0 : free(base_vtables);
28909 0 : return -1;
28910 : }
28911 : #endif
28912 :
28913 : /* SetupReduce */
28914 : #if !CYTHON_COMPILING_IN_LIMITED_API
28915 6 : static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
28916 6 : int ret;
28917 6 : PyObject *name_attr;
28918 6 : name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name_2);
28919 6 : if (likely(name_attr)) {
28920 6 : ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
28921 : } else {
28922 : ret = -1;
28923 : }
28924 6 : if (unlikely(ret < 0)) {
28925 0 : PyErr_Clear();
28926 0 : ret = 0;
28927 : }
28928 6 : Py_XDECREF(name_attr);
28929 6 : return ret;
28930 : }
28931 12 : static int __Pyx_setup_reduce(PyObject* type_obj) {
28932 12 : int ret = 0;
28933 12 : PyObject *object_reduce = NULL;
28934 12 : PyObject *object_getstate = NULL;
28935 12 : PyObject *object_reduce_ex = NULL;
28936 12 : PyObject *reduce = NULL;
28937 12 : PyObject *reduce_ex = NULL;
28938 12 : PyObject *reduce_cython = NULL;
28939 12 : PyObject *setstate = NULL;
28940 12 : PyObject *setstate_cython = NULL;
28941 12 : PyObject *getstate = NULL;
28942 : #if CYTHON_USE_PYTYPE_LOOKUP
28943 12 : getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
28944 : #else
28945 : getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
28946 : if (!getstate && PyErr_Occurred()) {
28947 : goto __PYX_BAD;
28948 : }
28949 : #endif
28950 12 : if (getstate) {
28951 : #if CYTHON_USE_PYTYPE_LOOKUP
28952 12 : object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
28953 : #else
28954 : object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
28955 : if (!object_getstate && PyErr_Occurred()) {
28956 : goto __PYX_BAD;
28957 : }
28958 : #endif
28959 12 : if (object_getstate != getstate) {
28960 0 : goto __PYX_GOOD;
28961 : }
28962 : }
28963 : #if CYTHON_USE_PYTYPE_LOOKUP
28964 12 : object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
28965 : #else
28966 : object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
28967 : #endif
28968 12 : reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
28969 12 : if (reduce_ex == object_reduce_ex) {
28970 : #if CYTHON_USE_PYTYPE_LOOKUP
28971 12 : object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
28972 : #else
28973 : object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
28974 : #endif
28975 12 : reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
28976 12 : if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
28977 12 : reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
28978 12 : if (likely(reduce_cython)) {
28979 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28980 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28981 0 : } else if (reduce == object_reduce || PyErr_Occurred()) {
28982 0 : goto __PYX_BAD;
28983 : }
28984 12 : setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
28985 12 : if (!setstate) PyErr_Clear();
28986 12 : if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
28987 12 : setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
28988 12 : if (likely(setstate_cython)) {
28989 12 : ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28990 12 : ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
28991 0 : } else if (!setstate || PyErr_Occurred()) {
28992 0 : goto __PYX_BAD;
28993 : }
28994 : }
28995 12 : PyType_Modified((PyTypeObject*)type_obj);
28996 : }
28997 : }
28998 12 : goto __PYX_GOOD;
28999 0 : __PYX_BAD:
29000 0 : if (!PyErr_Occurred()) {
29001 0 : __Pyx_TypeName type_obj_name =
29002 : __Pyx_PyType_GetName((PyTypeObject*)type_obj);
29003 0 : PyErr_Format(PyExc_RuntimeError,
29004 : "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
29005 : __Pyx_DECREF_TypeName(type_obj_name);
29006 : }
29007 : ret = -1;
29008 12 : __PYX_GOOD:
29009 : #if !CYTHON_USE_PYTYPE_LOOKUP
29010 : Py_XDECREF(object_reduce);
29011 : Py_XDECREF(object_reduce_ex);
29012 : Py_XDECREF(object_getstate);
29013 : Py_XDECREF(getstate);
29014 : #endif
29015 12 : Py_XDECREF(reduce);
29016 12 : Py_XDECREF(reduce_ex);
29017 12 : Py_XDECREF(reduce_cython);
29018 12 : Py_XDECREF(setstate);
29019 12 : Py_XDECREF(setstate_cython);
29020 12 : return ret;
29021 : }
29022 : #endif
29023 :
29024 : /* TypeImport */
29025 : #ifndef __PYX_HAVE_RT_ImportType_3_0_11
29026 : #define __PYX_HAVE_RT_ImportType_3_0_11
29027 48 : static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
29028 : size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
29029 : {
29030 48 : PyObject *result = 0;
29031 48 : char warning[200];
29032 48 : Py_ssize_t basicsize;
29033 48 : Py_ssize_t itemsize;
29034 : #if CYTHON_COMPILING_IN_LIMITED_API
29035 : PyObject *py_basicsize;
29036 : PyObject *py_itemsize;
29037 : #endif
29038 48 : result = PyObject_GetAttrString(module, class_name);
29039 48 : if (!result)
29040 0 : goto bad;
29041 48 : if (!PyType_Check(result)) {
29042 0 : PyErr_Format(PyExc_TypeError,
29043 : "%.200s.%.200s is not a type object",
29044 : module_name, class_name);
29045 0 : goto bad;
29046 : }
29047 : #if !CYTHON_COMPILING_IN_LIMITED_API
29048 48 : basicsize = ((PyTypeObject *)result)->tp_basicsize;
29049 48 : itemsize = ((PyTypeObject *)result)->tp_itemsize;
29050 : #else
29051 : py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
29052 : if (!py_basicsize)
29053 : goto bad;
29054 : basicsize = PyLong_AsSsize_t(py_basicsize);
29055 : Py_DECREF(py_basicsize);
29056 : py_basicsize = 0;
29057 : if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
29058 : goto bad;
29059 : py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
29060 : if (!py_itemsize)
29061 : goto bad;
29062 : itemsize = PyLong_AsSsize_t(py_itemsize);
29063 : Py_DECREF(py_itemsize);
29064 : py_itemsize = 0;
29065 : if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
29066 : goto bad;
29067 : #endif
29068 48 : if (itemsize) {
29069 3 : if (size % alignment) {
29070 0 : alignment = size % alignment;
29071 : }
29072 3 : if (itemsize < (Py_ssize_t)alignment)
29073 : itemsize = (Py_ssize_t)alignment;
29074 : }
29075 48 : if ((size_t)(basicsize + itemsize) < size) {
29076 0 : PyErr_Format(PyExc_ValueError,
29077 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
29078 : "Expected %zd from C header, got %zd from PyObject",
29079 : module_name, class_name, size, basicsize+itemsize);
29080 0 : goto bad;
29081 : }
29082 48 : if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
29083 0 : ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
29084 0 : PyErr_Format(PyExc_ValueError,
29085 : "%.200s.%.200s size changed, may indicate binary incompatibility. "
29086 : "Expected %zd from C header, got %zd-%zd from PyObject",
29087 : module_name, class_name, size, basicsize, basicsize+itemsize);
29088 0 : goto bad;
29089 : }
29090 48 : else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
29091 0 : PyOS_snprintf(warning, sizeof(warning),
29092 : "%s.%s size changed, may indicate binary incompatibility. "
29093 : "Expected %zd from C header, got %zd from PyObject",
29094 : module_name, class_name, size, basicsize);
29095 0 : if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
29096 : }
29097 : return (PyTypeObject *)result;
29098 0 : bad:
29099 0 : Py_XDECREF(result);
29100 0 : return NULL;
29101 : }
29102 : #endif
29103 :
29104 : /* FetchSharedCythonModule */
29105 3 : static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
29106 3 : return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
29107 : }
29108 :
29109 : /* FetchCommonType */
29110 3 : static int __Pyx_VerifyCachedType(PyObject *cached_type,
29111 : const char *name,
29112 : Py_ssize_t basicsize,
29113 : Py_ssize_t expected_basicsize) {
29114 3 : if (!PyType_Check(cached_type)) {
29115 0 : PyErr_Format(PyExc_TypeError,
29116 : "Shared Cython type %.200s is not a type object", name);
29117 0 : return -1;
29118 : }
29119 3 : if (basicsize != expected_basicsize) {
29120 0 : PyErr_Format(PyExc_TypeError,
29121 : "Shared Cython type %.200s has the wrong size, try recompiling",
29122 : name);
29123 0 : return -1;
29124 : }
29125 : return 0;
29126 : }
29127 : #if !CYTHON_USE_TYPE_SPECS
29128 3 : static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
29129 3 : PyObject* abi_module;
29130 3 : const char* object_name;
29131 3 : PyTypeObject *cached_type = NULL;
29132 3 : abi_module = __Pyx_FetchSharedCythonABIModule();
29133 3 : if (!abi_module) return NULL;
29134 3 : object_name = strrchr(type->tp_name, '.');
29135 3 : object_name = object_name ? object_name+1 : type->tp_name;
29136 3 : cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
29137 3 : if (cached_type) {
29138 3 : if (__Pyx_VerifyCachedType(
29139 : (PyObject *)cached_type,
29140 : object_name,
29141 : cached_type->tp_basicsize,
29142 : type->tp_basicsize) < 0) {
29143 0 : goto bad;
29144 : }
29145 3 : goto done;
29146 : }
29147 0 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
29148 0 : PyErr_Clear();
29149 0 : if (PyType_Ready(type) < 0) goto bad;
29150 0 : if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
29151 0 : goto bad;
29152 0 : Py_INCREF(type);
29153 : cached_type = type;
29154 3 : done:
29155 3 : Py_DECREF(abi_module);
29156 : return cached_type;
29157 0 : bad:
29158 0 : Py_XDECREF(cached_type);
29159 0 : cached_type = NULL;
29160 0 : goto done;
29161 : }
29162 : #else
29163 : static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
29164 : PyObject *abi_module, *cached_type = NULL;
29165 : const char* object_name = strrchr(spec->name, '.');
29166 : object_name = object_name ? object_name+1 : spec->name;
29167 : abi_module = __Pyx_FetchSharedCythonABIModule();
29168 : if (!abi_module) return NULL;
29169 : cached_type = PyObject_GetAttrString(abi_module, object_name);
29170 : if (cached_type) {
29171 : Py_ssize_t basicsize;
29172 : #if CYTHON_COMPILING_IN_LIMITED_API
29173 : PyObject *py_basicsize;
29174 : py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
29175 : if (unlikely(!py_basicsize)) goto bad;
29176 : basicsize = PyLong_AsSsize_t(py_basicsize);
29177 : Py_DECREF(py_basicsize);
29178 : py_basicsize = 0;
29179 : if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
29180 : #else
29181 : basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
29182 : #endif
29183 : if (__Pyx_VerifyCachedType(
29184 : cached_type,
29185 : object_name,
29186 : basicsize,
29187 : spec->basicsize) < 0) {
29188 : goto bad;
29189 : }
29190 : goto done;
29191 : }
29192 : if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
29193 : PyErr_Clear();
29194 : CYTHON_UNUSED_VAR(module);
29195 : cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
29196 : if (unlikely(!cached_type)) goto bad;
29197 : if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
29198 : if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
29199 : done:
29200 : Py_DECREF(abi_module);
29201 : assert(cached_type == NULL || PyType_Check(cached_type));
29202 : return (PyTypeObject *) cached_type;
29203 : bad:
29204 : Py_XDECREF(cached_type);
29205 : cached_type = NULL;
29206 : goto done;
29207 : }
29208 : #endif
29209 :
29210 : /* PyVectorcallFastCallDict */
29211 : #if CYTHON_METH_FASTCALL
29212 0 : static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
29213 : {
29214 0 : PyObject *res = NULL;
29215 0 : PyObject *kwnames;
29216 0 : PyObject **newargs;
29217 0 : PyObject **kwvalues;
29218 0 : Py_ssize_t i, pos;
29219 0 : size_t j;
29220 0 : PyObject *key, *value;
29221 0 : unsigned long keys_are_strings;
29222 0 : Py_ssize_t nkw = PyDict_GET_SIZE(kw);
29223 0 : newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
29224 0 : if (unlikely(newargs == NULL)) {
29225 0 : PyErr_NoMemory();
29226 0 : return NULL;
29227 : }
29228 0 : for (j = 0; j < nargs; j++) newargs[j] = args[j];
29229 0 : kwnames = PyTuple_New(nkw);
29230 0 : if (unlikely(kwnames == NULL)) {
29231 0 : PyMem_Free(newargs);
29232 0 : return NULL;
29233 : }
29234 0 : kwvalues = newargs + nargs;
29235 0 : pos = i = 0;
29236 0 : keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
29237 0 : while (PyDict_Next(kw, &pos, &key, &value)) {
29238 0 : keys_are_strings &= Py_TYPE(key)->tp_flags;
29239 0 : Py_INCREF(key);
29240 0 : Py_INCREF(value);
29241 0 : PyTuple_SET_ITEM(kwnames, i, key);
29242 0 : kwvalues[i] = value;
29243 0 : i++;
29244 : }
29245 0 : if (unlikely(!keys_are_strings)) {
29246 0 : PyErr_SetString(PyExc_TypeError, "keywords must be strings");
29247 0 : goto cleanup;
29248 : }
29249 0 : res = vc(func, newargs, nargs, kwnames);
29250 0 : cleanup:
29251 0 : Py_DECREF(kwnames);
29252 0 : for (i = 0; i < nkw; i++)
29253 0 : Py_DECREF(kwvalues[i]);
29254 0 : PyMem_Free(newargs);
29255 0 : return res;
29256 : }
29257 0 : static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
29258 : {
29259 0 : if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
29260 0 : return vc(func, args, nargs, NULL);
29261 : }
29262 0 : return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
29263 : }
29264 : #endif
29265 :
29266 : /* CythonFunctionShared */
29267 : #if CYTHON_COMPILING_IN_LIMITED_API
29268 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
29269 : if (__Pyx_CyFunction_Check(func)) {
29270 : return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
29271 : } else if (PyCFunction_Check(func)) {
29272 : return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
29273 : }
29274 : return 0;
29275 : }
29276 : #else
29277 : static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
29278 : return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
29279 : }
29280 : #endif
29281 : static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
29282 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
29283 : __Pyx_Py_XDECREF_SET(
29284 : __Pyx_CyFunction_GetClassObj(f),
29285 : ((classobj) ? __Pyx_NewRef(classobj) : NULL));
29286 : #else
29287 : __Pyx_Py_XDECREF_SET(
29288 : ((PyCMethodObject *) (f))->mm_class,
29289 : (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
29290 : #endif
29291 : }
29292 : static PyObject *
29293 0 : __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
29294 : {
29295 0 : CYTHON_UNUSED_VAR(closure);
29296 0 : if (unlikely(op->func_doc == NULL)) {
29297 : #if CYTHON_COMPILING_IN_LIMITED_API
29298 : op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
29299 : if (unlikely(!op->func_doc)) return NULL;
29300 : #else
29301 0 : if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
29302 : #if PY_MAJOR_VERSION >= 3
29303 0 : op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
29304 : #else
29305 : op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
29306 : #endif
29307 0 : if (unlikely(op->func_doc == NULL))
29308 : return NULL;
29309 : } else {
29310 0 : Py_INCREF(Py_None);
29311 0 : return Py_None;
29312 : }
29313 : #endif
29314 : }
29315 0 : Py_INCREF(op->func_doc);
29316 : return op->func_doc;
29317 : }
29318 : static int
29319 0 : __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
29320 : {
29321 0 : CYTHON_UNUSED_VAR(context);
29322 0 : if (value == NULL) {
29323 0 : value = Py_None;
29324 : }
29325 0 : Py_INCREF(value);
29326 0 : __Pyx_Py_XDECREF_SET(op->func_doc, value);
29327 0 : return 0;
29328 : }
29329 : static PyObject *
29330 0 : __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
29331 : {
29332 0 : CYTHON_UNUSED_VAR(context);
29333 0 : if (unlikely(op->func_name == NULL)) {
29334 : #if CYTHON_COMPILING_IN_LIMITED_API
29335 : op->func_name = PyObject_GetAttrString(op->func, "__name__");
29336 : #elif PY_MAJOR_VERSION >= 3
29337 0 : op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
29338 : #else
29339 : op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
29340 : #endif
29341 0 : if (unlikely(op->func_name == NULL))
29342 : return NULL;
29343 : }
29344 0 : Py_INCREF(op->func_name);
29345 : return op->func_name;
29346 : }
29347 : static int
29348 0 : __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
29349 : {
29350 0 : CYTHON_UNUSED_VAR(context);
29351 : #if PY_MAJOR_VERSION >= 3
29352 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
29353 : #else
29354 : if (unlikely(value == NULL || !PyString_Check(value)))
29355 : #endif
29356 : {
29357 0 : PyErr_SetString(PyExc_TypeError,
29358 : "__name__ must be set to a string object");
29359 0 : return -1;
29360 : }
29361 0 : Py_INCREF(value);
29362 0 : __Pyx_Py_XDECREF_SET(op->func_name, value);
29363 0 : return 0;
29364 : }
29365 : static PyObject *
29366 0 : __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
29367 : {
29368 0 : CYTHON_UNUSED_VAR(context);
29369 0 : Py_INCREF(op->func_qualname);
29370 0 : return op->func_qualname;
29371 : }
29372 : static int
29373 0 : __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
29374 : {
29375 0 : CYTHON_UNUSED_VAR(context);
29376 : #if PY_MAJOR_VERSION >= 3
29377 0 : if (unlikely(value == NULL || !PyUnicode_Check(value)))
29378 : #else
29379 : if (unlikely(value == NULL || !PyString_Check(value)))
29380 : #endif
29381 : {
29382 0 : PyErr_SetString(PyExc_TypeError,
29383 : "__qualname__ must be set to a string object");
29384 0 : return -1;
29385 : }
29386 0 : Py_INCREF(value);
29387 0 : __Pyx_Py_XDECREF_SET(op->func_qualname, value);
29388 0 : return 0;
29389 : }
29390 : static PyObject *
29391 0 : __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
29392 : {
29393 0 : CYTHON_UNUSED_VAR(context);
29394 0 : if (unlikely(op->func_dict == NULL)) {
29395 0 : op->func_dict = PyDict_New();
29396 0 : if (unlikely(op->func_dict == NULL))
29397 : return NULL;
29398 : }
29399 0 : Py_INCREF(op->func_dict);
29400 : return op->func_dict;
29401 : }
29402 : static int
29403 0 : __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
29404 : {
29405 0 : CYTHON_UNUSED_VAR(context);
29406 0 : if (unlikely(value == NULL)) {
29407 0 : PyErr_SetString(PyExc_TypeError,
29408 : "function's dictionary may not be deleted");
29409 0 : return -1;
29410 : }
29411 0 : if (unlikely(!PyDict_Check(value))) {
29412 0 : PyErr_SetString(PyExc_TypeError,
29413 : "setting function's dictionary to a non-dict");
29414 0 : return -1;
29415 : }
29416 0 : Py_INCREF(value);
29417 0 : __Pyx_Py_XDECREF_SET(op->func_dict, value);
29418 0 : return 0;
29419 : }
29420 : static PyObject *
29421 0 : __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
29422 : {
29423 0 : CYTHON_UNUSED_VAR(context);
29424 0 : Py_INCREF(op->func_globals);
29425 0 : return op->func_globals;
29426 : }
29427 : static PyObject *
29428 0 : __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
29429 : {
29430 0 : CYTHON_UNUSED_VAR(op);
29431 0 : CYTHON_UNUSED_VAR(context);
29432 0 : Py_INCREF(Py_None);
29433 0 : return Py_None;
29434 : }
29435 : static PyObject *
29436 0 : __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
29437 : {
29438 0 : PyObject* result = (op->func_code) ? op->func_code : Py_None;
29439 0 : CYTHON_UNUSED_VAR(context);
29440 0 : Py_INCREF(result);
29441 0 : return result;
29442 : }
29443 : static int
29444 0 : __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
29445 0 : int result = 0;
29446 0 : PyObject *res = op->defaults_getter((PyObject *) op);
29447 0 : if (unlikely(!res))
29448 : return -1;
29449 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29450 0 : op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
29451 0 : Py_INCREF(op->defaults_tuple);
29452 0 : op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
29453 0 : Py_INCREF(op->defaults_kwdict);
29454 : #else
29455 : op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
29456 : if (unlikely(!op->defaults_tuple)) result = -1;
29457 : else {
29458 : op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
29459 : if (unlikely(!op->defaults_kwdict)) result = -1;
29460 : }
29461 : #endif
29462 0 : Py_DECREF(res);
29463 : return result;
29464 : }
29465 : static int
29466 0 : __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
29467 0 : CYTHON_UNUSED_VAR(context);
29468 0 : if (!value) {
29469 : value = Py_None;
29470 0 : } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
29471 0 : PyErr_SetString(PyExc_TypeError,
29472 : "__defaults__ must be set to a tuple object");
29473 0 : return -1;
29474 : }
29475 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
29476 : "currently affect the values used in function calls", 1);
29477 0 : Py_INCREF(value);
29478 0 : __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
29479 0 : return 0;
29480 : }
29481 : static PyObject *
29482 0 : __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
29483 0 : PyObject* result = op->defaults_tuple;
29484 0 : CYTHON_UNUSED_VAR(context);
29485 0 : if (unlikely(!result)) {
29486 0 : if (op->defaults_getter) {
29487 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
29488 0 : result = op->defaults_tuple;
29489 : } else {
29490 : result = Py_None;
29491 : }
29492 : }
29493 0 : Py_INCREF(result);
29494 : return result;
29495 : }
29496 : static int
29497 0 : __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
29498 0 : CYTHON_UNUSED_VAR(context);
29499 0 : if (!value) {
29500 : value = Py_None;
29501 0 : } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
29502 0 : PyErr_SetString(PyExc_TypeError,
29503 : "__kwdefaults__ must be set to a dict object");
29504 0 : return -1;
29505 : }
29506 0 : PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
29507 : "currently affect the values used in function calls", 1);
29508 0 : Py_INCREF(value);
29509 0 : __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
29510 0 : return 0;
29511 : }
29512 : static PyObject *
29513 0 : __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
29514 0 : PyObject* result = op->defaults_kwdict;
29515 0 : CYTHON_UNUSED_VAR(context);
29516 0 : if (unlikely(!result)) {
29517 0 : if (op->defaults_getter) {
29518 0 : if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
29519 0 : result = op->defaults_kwdict;
29520 : } else {
29521 : result = Py_None;
29522 : }
29523 : }
29524 0 : Py_INCREF(result);
29525 : return result;
29526 : }
29527 : static int
29528 0 : __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
29529 0 : CYTHON_UNUSED_VAR(context);
29530 0 : if (!value || value == Py_None) {
29531 : value = NULL;
29532 0 : } else if (unlikely(!PyDict_Check(value))) {
29533 0 : PyErr_SetString(PyExc_TypeError,
29534 : "__annotations__ must be set to a dict object");
29535 0 : return -1;
29536 : }
29537 0 : Py_XINCREF(value);
29538 0 : __Pyx_Py_XDECREF_SET(op->func_annotations, value);
29539 0 : return 0;
29540 : }
29541 : static PyObject *
29542 0 : __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
29543 0 : PyObject* result = op->func_annotations;
29544 0 : CYTHON_UNUSED_VAR(context);
29545 0 : if (unlikely(!result)) {
29546 0 : result = PyDict_New();
29547 0 : if (unlikely(!result)) return NULL;
29548 0 : op->func_annotations = result;
29549 : }
29550 0 : Py_INCREF(result);
29551 : return result;
29552 : }
29553 : static PyObject *
29554 0 : __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
29555 0 : int is_coroutine;
29556 0 : CYTHON_UNUSED_VAR(context);
29557 0 : if (op->func_is_coroutine) {
29558 0 : return __Pyx_NewRef(op->func_is_coroutine);
29559 : }
29560 0 : is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
29561 : #if PY_VERSION_HEX >= 0x03050000
29562 0 : if (is_coroutine) {
29563 0 : PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
29564 0 : fromlist = PyList_New(1);
29565 0 : if (unlikely(!fromlist)) return NULL;
29566 0 : Py_INCREF(marker);
29567 : #if CYTHON_ASSUME_SAFE_MACROS
29568 0 : PyList_SET_ITEM(fromlist, 0, marker);
29569 : #else
29570 : if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
29571 : Py_DECREF(marker);
29572 : Py_DECREF(fromlist);
29573 : return NULL;
29574 : }
29575 : #endif
29576 0 : module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
29577 0 : Py_DECREF(fromlist);
29578 0 : if (unlikely(!module)) goto ignore;
29579 0 : op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
29580 0 : Py_DECREF(module);
29581 0 : if (likely(op->func_is_coroutine)) {
29582 0 : return __Pyx_NewRef(op->func_is_coroutine);
29583 : }
29584 0 : ignore:
29585 0 : PyErr_Clear();
29586 : }
29587 : #endif
29588 0 : op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
29589 0 : return __Pyx_NewRef(op->func_is_coroutine);
29590 : }
29591 : #if CYTHON_COMPILING_IN_LIMITED_API
29592 : static PyObject *
29593 : __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
29594 : CYTHON_UNUSED_VAR(context);
29595 : return PyObject_GetAttrString(op->func, "__module__");
29596 : }
29597 : static int
29598 : __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
29599 : CYTHON_UNUSED_VAR(context);
29600 : return PyObject_SetAttrString(op->func, "__module__", value);
29601 : }
29602 : #endif
29603 : static PyGetSetDef __pyx_CyFunction_getsets[] = {
29604 : {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
29605 : {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
29606 : {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
29607 : {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
29608 : {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
29609 : {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
29610 : {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
29611 : {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
29612 : {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
29613 : {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
29614 : {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
29615 : {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
29616 : {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
29617 : {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
29618 : {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
29619 : {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
29620 : {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
29621 : {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
29622 : #if CYTHON_COMPILING_IN_LIMITED_API
29623 : {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
29624 : #endif
29625 : {0, 0, 0, 0, 0}
29626 : };
29627 : static PyMemberDef __pyx_CyFunction_members[] = {
29628 : #if !CYTHON_COMPILING_IN_LIMITED_API
29629 : {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
29630 : #endif
29631 : #if CYTHON_USE_TYPE_SPECS
29632 : {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
29633 : #if CYTHON_METH_FASTCALL
29634 : #if CYTHON_BACKPORT_VECTORCALL
29635 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
29636 : #else
29637 : #if !CYTHON_COMPILING_IN_LIMITED_API
29638 : {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
29639 : #endif
29640 : #endif
29641 : #endif
29642 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
29643 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
29644 : #else
29645 : {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
29646 : #endif
29647 : #endif
29648 : {0, 0, 0, 0, 0}
29649 : };
29650 : static PyObject *
29651 0 : __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
29652 : {
29653 0 : CYTHON_UNUSED_VAR(args);
29654 : #if PY_MAJOR_VERSION >= 3
29655 0 : Py_INCREF(m->func_qualname);
29656 0 : return m->func_qualname;
29657 : #else
29658 : return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
29659 : #endif
29660 : }
29661 : static PyMethodDef __pyx_CyFunction_methods[] = {
29662 : {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
29663 : {0, 0, 0, 0}
29664 : };
29665 : #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
29666 : #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
29667 : #else
29668 : #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
29669 : #endif
29670 12 : static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
29671 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
29672 : #if !CYTHON_COMPILING_IN_LIMITED_API
29673 12 : PyCFunctionObject *cf = (PyCFunctionObject*) op;
29674 : #endif
29675 12 : if (unlikely(op == NULL))
29676 : return NULL;
29677 : #if CYTHON_COMPILING_IN_LIMITED_API
29678 : op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
29679 : if (unlikely(!op->func)) return NULL;
29680 : #endif
29681 12 : op->flags = flags;
29682 12 : __Pyx_CyFunction_weakreflist(op) = NULL;
29683 : #if !CYTHON_COMPILING_IN_LIMITED_API
29684 12 : cf->m_ml = ml;
29685 12 : cf->m_self = (PyObject *) op;
29686 : #endif
29687 12 : Py_XINCREF(closure);
29688 12 : op->func_closure = closure;
29689 : #if !CYTHON_COMPILING_IN_LIMITED_API
29690 12 : Py_XINCREF(module);
29691 12 : cf->m_module = module;
29692 : #endif
29693 12 : op->func_dict = NULL;
29694 12 : op->func_name = NULL;
29695 12 : Py_INCREF(qualname);
29696 12 : op->func_qualname = qualname;
29697 12 : op->func_doc = NULL;
29698 : #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
29699 : op->func_classobj = NULL;
29700 : #else
29701 12 : ((PyCMethodObject*)op)->mm_class = NULL;
29702 : #endif
29703 12 : op->func_globals = globals;
29704 12 : Py_INCREF(op->func_globals);
29705 12 : Py_XINCREF(code);
29706 12 : op->func_code = code;
29707 12 : op->defaults_pyobjects = 0;
29708 12 : op->defaults_size = 0;
29709 12 : op->defaults = NULL;
29710 12 : op->defaults_tuple = NULL;
29711 12 : op->defaults_kwdict = NULL;
29712 12 : op->defaults_getter = NULL;
29713 12 : op->func_annotations = NULL;
29714 12 : op->func_is_coroutine = NULL;
29715 : #if CYTHON_METH_FASTCALL
29716 12 : switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
29717 0 : case METH_NOARGS:
29718 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
29719 0 : break;
29720 0 : case METH_O:
29721 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
29722 0 : break;
29723 0 : case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
29724 0 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
29725 0 : break;
29726 12 : case METH_FASTCALL | METH_KEYWORDS:
29727 12 : __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
29728 12 : break;
29729 0 : case METH_VARARGS | METH_KEYWORDS:
29730 0 : __Pyx_CyFunction_func_vectorcall(op) = NULL;
29731 0 : break;
29732 0 : default:
29733 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
29734 0 : Py_DECREF(op);
29735 : return NULL;
29736 : }
29737 : #endif
29738 : return (PyObject *) op;
29739 : }
29740 : static int
29741 0 : __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
29742 : {
29743 0 : Py_CLEAR(m->func_closure);
29744 : #if CYTHON_COMPILING_IN_LIMITED_API
29745 : Py_CLEAR(m->func);
29746 : #else
29747 0 : Py_CLEAR(((PyCFunctionObject*)m)->m_module);
29748 : #endif
29749 0 : Py_CLEAR(m->func_dict);
29750 0 : Py_CLEAR(m->func_name);
29751 0 : Py_CLEAR(m->func_qualname);
29752 0 : Py_CLEAR(m->func_doc);
29753 0 : Py_CLEAR(m->func_globals);
29754 0 : Py_CLEAR(m->func_code);
29755 : #if !CYTHON_COMPILING_IN_LIMITED_API
29756 : #if PY_VERSION_HEX < 0x030900B1
29757 : Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
29758 : #else
29759 : {
29760 0 : PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
29761 0 : ((PyCMethodObject *) (m))->mm_class = NULL;
29762 0 : Py_XDECREF(cls);
29763 : }
29764 : #endif
29765 : #endif
29766 0 : Py_CLEAR(m->defaults_tuple);
29767 0 : Py_CLEAR(m->defaults_kwdict);
29768 0 : Py_CLEAR(m->func_annotations);
29769 0 : Py_CLEAR(m->func_is_coroutine);
29770 0 : if (m->defaults) {
29771 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
29772 : int i;
29773 0 : for (i = 0; i < m->defaults_pyobjects; i++)
29774 0 : Py_XDECREF(pydefaults[i]);
29775 0 : PyObject_Free(m->defaults);
29776 0 : m->defaults = NULL;
29777 : }
29778 0 : return 0;
29779 : }
29780 0 : static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
29781 : {
29782 0 : if (__Pyx_CyFunction_weakreflist(m) != NULL)
29783 0 : PyObject_ClearWeakRefs((PyObject *) m);
29784 0 : __Pyx_CyFunction_clear(m);
29785 0 : __Pyx_PyHeapTypeObject_GC_Del(m);
29786 0 : }
29787 0 : static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
29788 : {
29789 0 : PyObject_GC_UnTrack(m);
29790 0 : __Pyx__CyFunction_dealloc(m);
29791 0 : }
29792 0 : static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
29793 : {
29794 0 : Py_VISIT(m->func_closure);
29795 : #if CYTHON_COMPILING_IN_LIMITED_API
29796 : Py_VISIT(m->func);
29797 : #else
29798 0 : Py_VISIT(((PyCFunctionObject*)m)->m_module);
29799 : #endif
29800 0 : Py_VISIT(m->func_dict);
29801 0 : Py_VISIT(m->func_name);
29802 0 : Py_VISIT(m->func_qualname);
29803 0 : Py_VISIT(m->func_doc);
29804 0 : Py_VISIT(m->func_globals);
29805 0 : Py_VISIT(m->func_code);
29806 : #if !CYTHON_COMPILING_IN_LIMITED_API
29807 0 : Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
29808 : #endif
29809 0 : Py_VISIT(m->defaults_tuple);
29810 0 : Py_VISIT(m->defaults_kwdict);
29811 0 : Py_VISIT(m->func_is_coroutine);
29812 0 : if (m->defaults) {
29813 : PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
29814 : int i;
29815 0 : for (i = 0; i < m->defaults_pyobjects; i++)
29816 0 : Py_VISIT(pydefaults[i]);
29817 : }
29818 : return 0;
29819 : }
29820 : static PyObject*
29821 0 : __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
29822 : {
29823 : #if PY_MAJOR_VERSION >= 3
29824 0 : return PyUnicode_FromFormat("<cyfunction %U at %p>",
29825 : op->func_qualname, (void *)op);
29826 : #else
29827 : return PyString_FromFormat("<cyfunction %s at %p>",
29828 : PyString_AsString(op->func_qualname), (void *)op);
29829 : #endif
29830 : }
29831 0 : static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
29832 : #if CYTHON_COMPILING_IN_LIMITED_API
29833 : PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
29834 : PyObject *py_name = NULL;
29835 : PyCFunction meth;
29836 : int flags;
29837 : meth = PyCFunction_GetFunction(f);
29838 : if (unlikely(!meth)) return NULL;
29839 : flags = PyCFunction_GetFlags(f);
29840 : if (unlikely(flags < 0)) return NULL;
29841 : #else
29842 0 : PyCFunctionObject* f = (PyCFunctionObject*)func;
29843 0 : PyCFunction meth = f->m_ml->ml_meth;
29844 0 : int flags = f->m_ml->ml_flags;
29845 : #endif
29846 0 : Py_ssize_t size;
29847 0 : switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
29848 0 : case METH_VARARGS:
29849 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0))
29850 0 : return (*meth)(self, arg);
29851 : break;
29852 0 : case METH_VARARGS | METH_KEYWORDS:
29853 0 : return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
29854 0 : case METH_NOARGS:
29855 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
29856 : #if CYTHON_ASSUME_SAFE_MACROS
29857 0 : size = PyTuple_GET_SIZE(arg);
29858 : #else
29859 : size = PyTuple_Size(arg);
29860 : if (unlikely(size < 0)) return NULL;
29861 : #endif
29862 0 : if (likely(size == 0))
29863 0 : return (*meth)(self, NULL);
29864 : #if CYTHON_COMPILING_IN_LIMITED_API
29865 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
29866 : if (!py_name) return NULL;
29867 : PyErr_Format(PyExc_TypeError,
29868 : "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
29869 : py_name, size);
29870 : Py_DECREF(py_name);
29871 : #else
29872 0 : PyErr_Format(PyExc_TypeError,
29873 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
29874 0 : f->m_ml->ml_name, size);
29875 : #endif
29876 0 : return NULL;
29877 : }
29878 : break;
29879 0 : case METH_O:
29880 0 : if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
29881 : #if CYTHON_ASSUME_SAFE_MACROS
29882 0 : size = PyTuple_GET_SIZE(arg);
29883 : #else
29884 : size = PyTuple_Size(arg);
29885 : if (unlikely(size < 0)) return NULL;
29886 : #endif
29887 0 : if (likely(size == 1)) {
29888 0 : PyObject *result, *arg0;
29889 : #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
29890 0 : arg0 = PyTuple_GET_ITEM(arg, 0);
29891 : #else
29892 : arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
29893 : #endif
29894 0 : result = (*meth)(self, arg0);
29895 : #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
29896 : Py_DECREF(arg0);
29897 : #endif
29898 0 : return result;
29899 : }
29900 : #if CYTHON_COMPILING_IN_LIMITED_API
29901 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
29902 : if (!py_name) return NULL;
29903 : PyErr_Format(PyExc_TypeError,
29904 : "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
29905 : py_name, size);
29906 : Py_DECREF(py_name);
29907 : #else
29908 0 : PyErr_Format(PyExc_TypeError,
29909 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
29910 0 : f->m_ml->ml_name, size);
29911 : #endif
29912 0 : return NULL;
29913 : }
29914 : break;
29915 0 : default:
29916 0 : PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
29917 0 : return NULL;
29918 : }
29919 : #if CYTHON_COMPILING_IN_LIMITED_API
29920 : py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
29921 : if (!py_name) return NULL;
29922 : PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
29923 : py_name);
29924 : Py_DECREF(py_name);
29925 : #else
29926 0 : PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
29927 0 : f->m_ml->ml_name);
29928 : #endif
29929 0 : return NULL;
29930 : }
29931 0 : static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
29932 0 : PyObject *self, *result;
29933 : #if CYTHON_COMPILING_IN_LIMITED_API
29934 : self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
29935 : if (unlikely(!self) && PyErr_Occurred()) return NULL;
29936 : #else
29937 0 : self = ((PyCFunctionObject*)func)->m_self;
29938 : #endif
29939 0 : result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
29940 0 : return result;
29941 : }
29942 0 : static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
29943 0 : PyObject *result;
29944 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
29945 : #if CYTHON_METH_FASTCALL
29946 0 : __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
29947 0 : if (vc) {
29948 : #if CYTHON_ASSUME_SAFE_MACROS
29949 0 : return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
29950 : #else
29951 : (void) &__Pyx_PyVectorcall_FastCallDict;
29952 : return PyVectorcall_Call(func, args, kw);
29953 : #endif
29954 : }
29955 : #endif
29956 0 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
29957 0 : Py_ssize_t argc;
29958 0 : PyObject *new_args;
29959 0 : PyObject *self;
29960 : #if CYTHON_ASSUME_SAFE_MACROS
29961 0 : argc = PyTuple_GET_SIZE(args);
29962 : #else
29963 : argc = PyTuple_Size(args);
29964 : if (unlikely(!argc) < 0) return NULL;
29965 : #endif
29966 0 : new_args = PyTuple_GetSlice(args, 1, argc);
29967 0 : if (unlikely(!new_args))
29968 : return NULL;
29969 0 : self = PyTuple_GetItem(args, 0);
29970 0 : if (unlikely(!self)) {
29971 0 : Py_DECREF(new_args);
29972 : #if PY_MAJOR_VERSION > 2
29973 0 : PyErr_Format(PyExc_TypeError,
29974 : "unbound method %.200S() needs an argument",
29975 : cyfunc->func_qualname);
29976 : #else
29977 : PyErr_SetString(PyExc_TypeError,
29978 : "unbound method needs an argument");
29979 : #endif
29980 0 : return NULL;
29981 : }
29982 0 : result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
29983 0 : Py_DECREF(new_args);
29984 : } else {
29985 0 : result = __Pyx_CyFunction_Call(func, args, kw);
29986 : }
29987 : return result;
29988 : }
29989 : #if CYTHON_METH_FASTCALL
29990 121 : static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
29991 : {
29992 121 : int ret = 0;
29993 121 : if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
29994 0 : if (unlikely(nargs < 1)) {
29995 0 : PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
29996 0 : ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
29997 0 : return -1;
29998 : }
29999 : ret = 1;
30000 : }
30001 121 : if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
30002 0 : PyErr_Format(PyExc_TypeError,
30003 0 : "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
30004 0 : return -1;
30005 : }
30006 : return ret;
30007 : }
30008 0 : static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
30009 : {
30010 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
30011 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
30012 : #if CYTHON_BACKPORT_VECTORCALL
30013 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
30014 : #else
30015 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
30016 : #endif
30017 0 : PyObject *self;
30018 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
30019 0 : case 1:
30020 0 : self = args[0];
30021 0 : args += 1;
30022 0 : nargs -= 1;
30023 0 : break;
30024 0 : case 0:
30025 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
30026 0 : break;
30027 : default:
30028 : return NULL;
30029 : }
30030 0 : if (unlikely(nargs != 0)) {
30031 0 : PyErr_Format(PyExc_TypeError,
30032 : "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
30033 : def->ml_name, nargs);
30034 0 : return NULL;
30035 : }
30036 0 : return def->ml_meth(self, NULL);
30037 : }
30038 0 : static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
30039 : {
30040 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
30041 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
30042 : #if CYTHON_BACKPORT_VECTORCALL
30043 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
30044 : #else
30045 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
30046 : #endif
30047 0 : PyObject *self;
30048 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
30049 0 : case 1:
30050 0 : self = args[0];
30051 0 : args += 1;
30052 0 : nargs -= 1;
30053 0 : break;
30054 0 : case 0:
30055 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
30056 0 : break;
30057 : default:
30058 : return NULL;
30059 : }
30060 0 : if (unlikely(nargs != 1)) {
30061 0 : PyErr_Format(PyExc_TypeError,
30062 : "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
30063 : def->ml_name, nargs);
30064 0 : return NULL;
30065 : }
30066 0 : return def->ml_meth(self, args[0]);
30067 : }
30068 121 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
30069 : {
30070 121 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
30071 121 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
30072 : #if CYTHON_BACKPORT_VECTORCALL
30073 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
30074 : #else
30075 121 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
30076 : #endif
30077 121 : PyObject *self;
30078 121 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
30079 0 : case 1:
30080 0 : self = args[0];
30081 0 : args += 1;
30082 0 : nargs -= 1;
30083 0 : break;
30084 121 : case 0:
30085 121 : self = ((PyCFunctionObject*)cyfunc)->m_self;
30086 121 : break;
30087 : default:
30088 : return NULL;
30089 : }
30090 121 : return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
30091 : }
30092 0 : static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
30093 : {
30094 0 : __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
30095 0 : PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
30096 0 : PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
30097 : #if CYTHON_BACKPORT_VECTORCALL
30098 : Py_ssize_t nargs = (Py_ssize_t)nargsf;
30099 : #else
30100 0 : Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
30101 : #endif
30102 0 : PyObject *self;
30103 0 : switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
30104 0 : case 1:
30105 0 : self = args[0];
30106 0 : args += 1;
30107 0 : nargs -= 1;
30108 0 : break;
30109 0 : case 0:
30110 0 : self = ((PyCFunctionObject*)cyfunc)->m_self;
30111 0 : break;
30112 : default:
30113 : return NULL;
30114 : }
30115 0 : return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
30116 : }
30117 : #endif
30118 : #if CYTHON_USE_TYPE_SPECS
30119 : static PyType_Slot __pyx_CyFunctionType_slots[] = {
30120 : {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
30121 : {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
30122 : {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
30123 : {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
30124 : {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
30125 : {Py_tp_methods, (void *)__pyx_CyFunction_methods},
30126 : {Py_tp_members, (void *)__pyx_CyFunction_members},
30127 : {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
30128 : {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
30129 : {0, 0},
30130 : };
30131 : static PyType_Spec __pyx_CyFunctionType_spec = {
30132 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
30133 : sizeof(__pyx_CyFunctionObject),
30134 : 0,
30135 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
30136 : Py_TPFLAGS_METHOD_DESCRIPTOR |
30137 : #endif
30138 : #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
30139 : _Py_TPFLAGS_HAVE_VECTORCALL |
30140 : #endif
30141 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
30142 : __pyx_CyFunctionType_slots
30143 : };
30144 : #else
30145 : static PyTypeObject __pyx_CyFunctionType_type = {
30146 : PyVarObject_HEAD_INIT(0, 0)
30147 : __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
30148 : sizeof(__pyx_CyFunctionObject),
30149 : 0,
30150 : (destructor) __Pyx_CyFunction_dealloc,
30151 : #if !CYTHON_METH_FASTCALL
30152 : 0,
30153 : #elif CYTHON_BACKPORT_VECTORCALL
30154 : (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
30155 : #else
30156 : offsetof(PyCFunctionObject, vectorcall),
30157 : #endif
30158 : 0,
30159 : 0,
30160 : #if PY_MAJOR_VERSION < 3
30161 : 0,
30162 : #else
30163 : 0,
30164 : #endif
30165 : (reprfunc) __Pyx_CyFunction_repr,
30166 : 0,
30167 : 0,
30168 : 0,
30169 : 0,
30170 : __Pyx_CyFunction_CallAsMethod,
30171 : 0,
30172 : 0,
30173 : 0,
30174 : 0,
30175 : #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
30176 : Py_TPFLAGS_METHOD_DESCRIPTOR |
30177 : #endif
30178 : #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
30179 : _Py_TPFLAGS_HAVE_VECTORCALL |
30180 : #endif
30181 : Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
30182 : 0,
30183 : (traverseproc) __Pyx_CyFunction_traverse,
30184 : (inquiry) __Pyx_CyFunction_clear,
30185 : 0,
30186 : #if PY_VERSION_HEX < 0x030500A0
30187 : offsetof(__pyx_CyFunctionObject, func_weakreflist),
30188 : #else
30189 : offsetof(PyCFunctionObject, m_weakreflist),
30190 : #endif
30191 : 0,
30192 : 0,
30193 : __pyx_CyFunction_methods,
30194 : __pyx_CyFunction_members,
30195 : __pyx_CyFunction_getsets,
30196 : 0,
30197 : 0,
30198 : __Pyx_PyMethod_New,
30199 : 0,
30200 : offsetof(__pyx_CyFunctionObject, func_dict),
30201 : 0,
30202 : 0,
30203 : 0,
30204 : 0,
30205 : 0,
30206 : 0,
30207 : 0,
30208 : 0,
30209 : 0,
30210 : 0,
30211 : 0,
30212 : 0,
30213 : #if PY_VERSION_HEX >= 0x030400a1
30214 : 0,
30215 : #endif
30216 : #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
30217 : 0,
30218 : #endif
30219 : #if __PYX_NEED_TP_PRINT_SLOT
30220 : 0,
30221 : #endif
30222 : #if PY_VERSION_HEX >= 0x030C0000
30223 : 0,
30224 : #endif
30225 : #if PY_VERSION_HEX >= 0x030d00A4
30226 : 0,
30227 : #endif
30228 : #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
30229 : 0,
30230 : #endif
30231 : };
30232 : #endif
30233 3 : static int __pyx_CyFunction_init(PyObject *module) {
30234 : #if CYTHON_USE_TYPE_SPECS
30235 : __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
30236 : #else
30237 3 : CYTHON_UNUSED_VAR(module);
30238 3 : __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
30239 : #endif
30240 3 : if (unlikely(__pyx_CyFunctionType == NULL)) {
30241 0 : return -1;
30242 : }
30243 : return 0;
30244 : }
30245 : static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
30246 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30247 : m->defaults = PyObject_Malloc(size);
30248 : if (unlikely(!m->defaults))
30249 : return PyErr_NoMemory();
30250 : memset(m->defaults, 0, size);
30251 : m->defaults_pyobjects = pyobjects;
30252 : m->defaults_size = size;
30253 : return m->defaults;
30254 : }
30255 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
30256 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30257 : m->defaults_tuple = tuple;
30258 : Py_INCREF(tuple);
30259 : }
30260 : static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
30261 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30262 : m->defaults_kwdict = dict;
30263 : Py_INCREF(dict);
30264 : }
30265 : static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
30266 : __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
30267 : m->func_annotations = dict;
30268 : Py_INCREF(dict);
30269 : }
30270 :
30271 : /* CythonFunction */
30272 12 : static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
30273 : PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
30274 12 : PyObject *op = __Pyx_CyFunction_Init(
30275 12 : PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
30276 : ml, flags, qualname, closure, module, globals, code
30277 : );
30278 12 : if (likely(op)) {
30279 12 : PyObject_GC_Track(op);
30280 : }
30281 12 : return op;
30282 : }
30283 :
30284 : /* Py3UpdateBases */
30285 : static PyObject*
30286 3 : __Pyx_PEP560_update_bases(PyObject *bases)
30287 : {
30288 3 : Py_ssize_t i, j, size_bases;
30289 3 : PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
30290 3 : size_bases = PyTuple_GET_SIZE(bases);
30291 6 : for (i = 0; i < size_bases; i++) {
30292 3 : base = PyTuple_GET_ITEM(bases, i);
30293 3 : if (PyType_Check(base)) {
30294 3 : if (new_bases) {
30295 0 : if (PyList_Append(new_bases, base) < 0) {
30296 0 : goto error;
30297 : }
30298 : }
30299 3 : continue;
30300 : }
30301 0 : meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
30302 0 : if (!meth && PyErr_Occurred()) {
30303 0 : goto error;
30304 : }
30305 0 : if (!meth) {
30306 0 : if (new_bases) {
30307 0 : if (PyList_Append(new_bases, base) < 0) {
30308 0 : goto error;
30309 : }
30310 : }
30311 0 : continue;
30312 : }
30313 0 : new_base = __Pyx_PyObject_CallOneArg(meth, bases);
30314 0 : Py_DECREF(meth);
30315 0 : if (!new_base) {
30316 0 : goto error;
30317 : }
30318 0 : if (!PyTuple_Check(new_base)) {
30319 0 : PyErr_SetString(PyExc_TypeError,
30320 : "__mro_entries__ must return a tuple");
30321 0 : Py_DECREF(new_base);
30322 0 : goto error;
30323 : }
30324 0 : if (!new_bases) {
30325 0 : if (!(new_bases = PyList_New(i))) {
30326 0 : goto error;
30327 : }
30328 0 : for (j = 0; j < i; j++) {
30329 0 : base = PyTuple_GET_ITEM(bases, j);
30330 0 : PyList_SET_ITEM(new_bases, j, base);
30331 0 : Py_INCREF(base);
30332 : }
30333 : }
30334 0 : j = PyList_GET_SIZE(new_bases);
30335 0 : if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
30336 0 : goto error;
30337 : }
30338 3 : Py_DECREF(new_base);
30339 : }
30340 3 : if (!new_bases) {
30341 3 : Py_INCREF(bases);
30342 3 : return bases;
30343 : }
30344 0 : result = PyList_AsTuple(new_bases);
30345 0 : Py_DECREF(new_bases);
30346 : return result;
30347 0 : error:
30348 0 : Py_XDECREF(new_bases);
30349 0 : return NULL;
30350 : }
30351 :
30352 : /* CalculateMetaclass */
30353 3 : static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
30354 3 : Py_ssize_t i, nbases;
30355 : #if CYTHON_ASSUME_SAFE_MACROS
30356 3 : nbases = PyTuple_GET_SIZE(bases);
30357 : #else
30358 : nbases = PyTuple_Size(bases);
30359 : if (nbases < 0) return NULL;
30360 : #endif
30361 6 : for (i=0; i < nbases; i++) {
30362 3 : PyTypeObject *tmptype;
30363 : #if CYTHON_ASSUME_SAFE_MACROS
30364 3 : PyObject *tmp = PyTuple_GET_ITEM(bases, i);
30365 : #else
30366 : PyObject *tmp = PyTuple_GetItem(bases, i);
30367 : if (!tmp) return NULL;
30368 : #endif
30369 3 : tmptype = Py_TYPE(tmp);
30370 : #if PY_MAJOR_VERSION < 3
30371 : if (tmptype == &PyClass_Type)
30372 : continue;
30373 : #endif
30374 3 : if (!metaclass) {
30375 3 : metaclass = tmptype;
30376 3 : continue;
30377 : }
30378 0 : if (PyType_IsSubtype(metaclass, tmptype))
30379 0 : continue;
30380 0 : if (PyType_IsSubtype(tmptype, metaclass)) {
30381 0 : metaclass = tmptype;
30382 0 : continue;
30383 : }
30384 0 : PyErr_SetString(PyExc_TypeError,
30385 : "metaclass conflict: "
30386 : "the metaclass of a derived class "
30387 : "must be a (non-strict) subclass "
30388 : "of the metaclasses of all its bases");
30389 0 : return NULL;
30390 : }
30391 3 : if (!metaclass) {
30392 : #if PY_MAJOR_VERSION < 3
30393 : metaclass = &PyClass_Type;
30394 : #else
30395 0 : metaclass = &PyType_Type;
30396 : #endif
30397 : }
30398 3 : Py_INCREF((PyObject*) metaclass);
30399 : return (PyObject*) metaclass;
30400 : }
30401 :
30402 : /* PyObjectCall2Args */
30403 : static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
30404 : PyObject *args[3] = {NULL, arg1, arg2};
30405 : return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
30406 : }
30407 :
30408 : /* PyObjectLookupSpecial */
30409 : #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
30410 : static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
30411 : PyObject *res;
30412 : PyTypeObject *tp = Py_TYPE(obj);
30413 : #if PY_MAJOR_VERSION < 3
30414 : if (unlikely(PyInstance_Check(obj)))
30415 : return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
30416 : #endif
30417 : res = _PyType_Lookup(tp, attr_name);
30418 : if (likely(res)) {
30419 : descrgetfunc f = Py_TYPE(res)->tp_descr_get;
30420 : if (!f) {
30421 : Py_INCREF(res);
30422 : } else {
30423 : res = f(res, obj, (PyObject *)tp);
30424 : }
30425 : } else if (with_error) {
30426 : PyErr_SetObject(PyExc_AttributeError, attr_name);
30427 : }
30428 : return res;
30429 : }
30430 : #endif
30431 :
30432 : /* Py3ClassCreate */
30433 3 : static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
30434 : PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
30435 3 : PyObject *ns;
30436 3 : if (metaclass) {
30437 3 : PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
30438 3 : if (prep) {
30439 3 : PyObject *pargs[3] = {NULL, name, bases};
30440 3 : ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
30441 6 : Py_DECREF(prep);
30442 : } else {
30443 0 : if (unlikely(PyErr_Occurred()))
30444 : return NULL;
30445 0 : ns = PyDict_New();
30446 : }
30447 : } else {
30448 0 : ns = PyDict_New();
30449 : }
30450 3 : if (unlikely(!ns))
30451 : return NULL;
30452 3 : if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
30453 : #if PY_VERSION_HEX >= 0x03030000
30454 3 : if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
30455 : #else
30456 : CYTHON_MAYBE_UNUSED_VAR(qualname);
30457 : #endif
30458 3 : if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
30459 : return ns;
30460 0 : bad:
30461 0 : Py_DECREF(ns);
30462 : return NULL;
30463 : }
30464 : #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
30465 : static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
30466 : PyTypeObject *type = (PyTypeObject*) type_obj;
30467 : PyObject *names_to_set, *key, *value, *set_name, *tmp;
30468 : Py_ssize_t i = 0;
30469 : #if CYTHON_USE_TYPE_SLOTS
30470 : names_to_set = PyDict_Copy(type->tp_dict);
30471 : #else
30472 : {
30473 : PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
30474 : names_to_set = NULL;
30475 : if (likely(d)) {
30476 : PyObject *names_to_set = PyDict_New();
30477 : int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
30478 : Py_DECREF(d);
30479 : if (unlikely(ret < 0))
30480 : Py_CLEAR(names_to_set);
30481 : }
30482 : }
30483 : #endif
30484 : if (unlikely(names_to_set == NULL))
30485 : goto bad;
30486 : while (PyDict_Next(names_to_set, &i, &key, &value)) {
30487 : set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
30488 : if (unlikely(set_name != NULL)) {
30489 : tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
30490 : Py_DECREF(set_name);
30491 : if (unlikely(tmp == NULL)) {
30492 : __Pyx_TypeName value_type_name =
30493 : __Pyx_PyType_GetName(Py_TYPE(value));
30494 : __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
30495 : PyErr_Format(PyExc_RuntimeError,
30496 : #if PY_MAJOR_VERSION >= 3
30497 : "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
30498 : value_type_name, key, type_name);
30499 : #else
30500 : "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
30501 : value_type_name,
30502 : PyString_Check(key) ? PyString_AS_STRING(key) : "?",
30503 : type_name);
30504 : #endif
30505 : goto bad;
30506 : } else {
30507 : Py_DECREF(tmp);
30508 : }
30509 : }
30510 : else if (unlikely(PyErr_Occurred())) {
30511 : goto bad;
30512 : }
30513 : }
30514 : Py_DECREF(names_to_set);
30515 : return 0;
30516 : bad:
30517 : Py_XDECREF(names_to_set);
30518 : return -1;
30519 : }
30520 : static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
30521 : #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
30522 : PyTypeObject *type = (PyTypeObject*) type_obj;
30523 : PyObject *mro = type->tp_mro;
30524 : Py_ssize_t i, nbases;
30525 : if (unlikely(!mro)) goto done;
30526 : (void) &__Pyx_GetBuiltinName;
30527 : Py_INCREF(mro);
30528 : nbases = PyTuple_GET_SIZE(mro);
30529 : assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
30530 : for (i = 1; i < nbases-1; i++) {
30531 : PyObject *base, *dict, *meth;
30532 : base = PyTuple_GET_ITEM(mro, i);
30533 : dict = ((PyTypeObject *)base)->tp_dict;
30534 : meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
30535 : if (unlikely(meth)) {
30536 : descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
30537 : PyObject *res;
30538 : Py_INCREF(meth);
30539 : if (likely(f)) {
30540 : res = f(meth, NULL, type_obj);
30541 : Py_DECREF(meth);
30542 : if (unlikely(!res)) goto bad;
30543 : meth = res;
30544 : }
30545 : res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
30546 : Py_DECREF(meth);
30547 : if (unlikely(!res)) goto bad;
30548 : Py_DECREF(res);
30549 : goto done;
30550 : } else if (unlikely(PyErr_Occurred())) {
30551 : goto bad;
30552 : }
30553 : }
30554 : done:
30555 : Py_XDECREF(mro);
30556 : return type_obj;
30557 : bad:
30558 : Py_XDECREF(mro);
30559 : Py_DECREF(type_obj);
30560 : return NULL;
30561 : #else
30562 : PyObject *super_type, *super, *func, *res;
30563 : #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
30564 : super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
30565 : #else
30566 : super_type = (PyObject*) &PySuper_Type;
30567 : (void) &__Pyx_GetBuiltinName;
30568 : #endif
30569 : super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
30570 : #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
30571 : Py_XDECREF(super_type);
30572 : #endif
30573 : if (unlikely(!super)) {
30574 : Py_CLEAR(type_obj);
30575 : goto done;
30576 : }
30577 : func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
30578 : Py_DECREF(super);
30579 : if (likely(!func)) {
30580 : if (unlikely(PyErr_Occurred()))
30581 : Py_CLEAR(type_obj);
30582 : goto done;
30583 : }
30584 : res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
30585 : Py_DECREF(func);
30586 : if (unlikely(!res))
30587 : Py_CLEAR(type_obj);
30588 : Py_XDECREF(res);
30589 : done:
30590 : return type_obj;
30591 : #endif
30592 : }
30593 : #endif
30594 3 : static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
30595 : PyObject *dict, PyObject *mkw,
30596 : int calculate_metaclass, int allow_py2_metaclass) {
30597 3 : PyObject *result;
30598 3 : PyObject *owned_metaclass = NULL;
30599 3 : PyObject *margs[4] = {NULL, name, bases, dict};
30600 3 : if (allow_py2_metaclass) {
30601 0 : owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
30602 0 : if (owned_metaclass) {
30603 : metaclass = owned_metaclass;
30604 0 : } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
30605 0 : PyErr_Clear();
30606 : } else {
30607 : return NULL;
30608 : }
30609 : }
30610 3 : if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
30611 0 : metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
30612 0 : Py_XDECREF(owned_metaclass);
30613 0 : if (unlikely(!metaclass))
30614 : return NULL;
30615 : owned_metaclass = metaclass;
30616 : }
30617 3 : result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
30618 : #if PY_VERSION_HEX < 0x030600A4
30619 : (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
30620 : #else
30621 : mkw
30622 : #endif
30623 : );
30624 3 : Py_XDECREF(owned_metaclass);
30625 : #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
30626 : if (likely(result) && likely(PyType_Check(result))) {
30627 : if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
30628 : Py_CLEAR(result);
30629 : } else {
30630 : result = __Pyx_InitSubclassPEP487(result, mkw);
30631 : }
30632 : }
30633 : #else
30634 3 : (void) &__Pyx_GetBuiltinName;
30635 : #endif
30636 3 : return result;
30637 : }
30638 :
30639 : /* CLineInTraceback */
30640 : #ifndef CYTHON_CLINE_IN_TRACEBACK
30641 20 : static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
30642 20 : PyObject *use_cline;
30643 20 : PyObject *ptype, *pvalue, *ptraceback;
30644 : #if CYTHON_COMPILING_IN_CPYTHON
30645 20 : PyObject **cython_runtime_dict;
30646 : #endif
30647 20 : CYTHON_MAYBE_UNUSED_VAR(tstate);
30648 20 : if (unlikely(!__pyx_cython_runtime)) {
30649 : return c_line;
30650 : }
30651 20 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
30652 : #if CYTHON_COMPILING_IN_CPYTHON
30653 20 : cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
30654 20 : if (likely(cython_runtime_dict)) {
30655 20 : __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
30656 : use_cline, *cython_runtime_dict,
30657 : __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
30658 : } else
30659 : #endif
30660 : {
30661 0 : PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
30662 0 : if (use_cline_obj) {
30663 0 : use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
30664 0 : Py_DECREF(use_cline_obj);
30665 : } else {
30666 0 : PyErr_Clear();
30667 0 : use_cline = NULL;
30668 : }
30669 : }
30670 20 : if (!use_cline) {
30671 0 : c_line = 0;
30672 0 : (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
30673 : }
30674 20 : else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
30675 : c_line = 0;
30676 : }
30677 20 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
30678 20 : return c_line;
30679 : }
30680 : #endif
30681 :
30682 : /* CodeObjectCache */
30683 : #if !CYTHON_COMPILING_IN_LIMITED_API
30684 25 : static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
30685 25 : int start = 0, mid = 0, end = count - 1;
30686 25 : if (end >= 0 && code_line > entries[end].code_line) {
30687 : return count;
30688 : }
30689 44 : while (start < end) {
30690 35 : mid = start + (end - start) / 2;
30691 35 : if (code_line < entries[mid].code_line) {
30692 : end = mid;
30693 22 : } else if (code_line > entries[mid].code_line) {
30694 10 : start = mid + 1;
30695 : } else {
30696 12 : return mid;
30697 : }
30698 : }
30699 9 : if (code_line <= entries[mid].code_line) {
30700 : return mid;
30701 : } else {
30702 2 : return mid + 1;
30703 : }
30704 : }
30705 20 : static PyCodeObject *__pyx_find_code_object(int code_line) {
30706 20 : PyCodeObject* code_object;
30707 20 : int pos;
30708 20 : if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
30709 : return NULL;
30710 : }
30711 19 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
30712 19 : if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
30713 : return NULL;
30714 : }
30715 13 : code_object = __pyx_code_cache.entries[pos].code_object;
30716 13 : Py_INCREF(code_object);
30717 : return code_object;
30718 : }
30719 7 : static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
30720 7 : int pos, i;
30721 7 : __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
30722 7 : if (unlikely(!code_line)) {
30723 : return;
30724 : }
30725 7 : if (unlikely(!entries)) {
30726 1 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
30727 1 : if (likely(entries)) {
30728 1 : __pyx_code_cache.entries = entries;
30729 1 : __pyx_code_cache.max_count = 64;
30730 1 : __pyx_code_cache.count = 1;
30731 1 : entries[0].code_line = code_line;
30732 1 : entries[0].code_object = code_object;
30733 1 : Py_INCREF(code_object);
30734 : }
30735 1 : return;
30736 : }
30737 6 : pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
30738 6 : if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
30739 0 : PyCodeObject* tmp = entries[pos].code_object;
30740 0 : entries[pos].code_object = code_object;
30741 0 : Py_DECREF(tmp);
30742 0 : return;
30743 : }
30744 6 : if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
30745 0 : int new_max = __pyx_code_cache.max_count + 64;
30746 0 : entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
30747 0 : __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
30748 0 : if (unlikely(!entries)) {
30749 : return;
30750 : }
30751 0 : __pyx_code_cache.entries = entries;
30752 0 : __pyx_code_cache.max_count = new_max;
30753 : }
30754 15 : for (i=__pyx_code_cache.count; i>pos; i--) {
30755 9 : entries[i] = entries[i-1];
30756 : }
30757 6 : entries[pos].code_line = code_line;
30758 6 : entries[pos].code_object = code_object;
30759 6 : __pyx_code_cache.count++;
30760 6 : Py_INCREF(code_object);
30761 : }
30762 : #endif
30763 :
30764 : /* AddTraceback */
30765 : #include "compile.h"
30766 : #include "frameobject.h"
30767 : #include "traceback.h"
30768 : #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
30769 : #ifndef Py_BUILD_CORE
30770 : #define Py_BUILD_CORE 1
30771 : #endif
30772 : #include "internal/pycore_frame.h"
30773 : #endif
30774 : #if CYTHON_COMPILING_IN_LIMITED_API
30775 : static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
30776 : PyObject *firstlineno, PyObject *name) {
30777 : PyObject *replace = NULL;
30778 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
30779 : if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
30780 : replace = PyObject_GetAttrString(code, "replace");
30781 : if (likely(replace)) {
30782 : PyObject *result;
30783 : result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
30784 : Py_DECREF(replace);
30785 : return result;
30786 : }
30787 : PyErr_Clear();
30788 : #if __PYX_LIMITED_VERSION_HEX < 0x030780000
30789 : {
30790 : PyObject *compiled = NULL, *result = NULL;
30791 : if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
30792 : if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
30793 : compiled = Py_CompileString(
30794 : "out = type(code)(\n"
30795 : " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
30796 : " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
30797 : " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
30798 : " code.co_lnotab)\n", "<dummy>", Py_file_input);
30799 : if (!compiled) return NULL;
30800 : result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
30801 : Py_DECREF(compiled);
30802 : if (!result) PyErr_Print();
30803 : Py_DECREF(result);
30804 : result = PyDict_GetItemString(scratch_dict, "out");
30805 : if (result) Py_INCREF(result);
30806 : return result;
30807 : }
30808 : #else
30809 : return NULL;
30810 : #endif
30811 : }
30812 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
30813 : int py_line, const char *filename) {
30814 : PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
30815 : PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
30816 : PyObject *exc_type, *exc_value, *exc_traceback;
30817 : int success = 0;
30818 : if (c_line) {
30819 : (void) __pyx_cfilenm;
30820 : (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
30821 : }
30822 : PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
30823 : code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
30824 : if (unlikely(!code_object)) goto bad;
30825 : py_py_line = PyLong_FromLong(py_line);
30826 : if (unlikely(!py_py_line)) goto bad;
30827 : py_funcname = PyUnicode_FromString(funcname);
30828 : if (unlikely(!py_funcname)) goto bad;
30829 : dict = PyDict_New();
30830 : if (unlikely(!dict)) goto bad;
30831 : {
30832 : PyObject *old_code_object = code_object;
30833 : code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
30834 : Py_DECREF(old_code_object);
30835 : }
30836 : if (unlikely(!code_object)) goto bad;
30837 : getframe = PySys_GetObject("_getframe");
30838 : if (unlikely(!getframe)) goto bad;
30839 : if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
30840 : frame = PyEval_EvalCode(code_object, dict, dict);
30841 : if (unlikely(!frame) || frame == Py_None) goto bad;
30842 : success = 1;
30843 : bad:
30844 : PyErr_Restore(exc_type, exc_value, exc_traceback);
30845 : Py_XDECREF(code_object);
30846 : Py_XDECREF(py_py_line);
30847 : Py_XDECREF(py_funcname);
30848 : Py_XDECREF(dict);
30849 : Py_XDECREF(replace);
30850 : if (success) {
30851 : PyTraceBack_Here(
30852 : (struct _frame*)frame);
30853 : }
30854 : Py_XDECREF(frame);
30855 : }
30856 : #else
30857 7 : static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
30858 : const char *funcname, int c_line,
30859 : int py_line, const char *filename) {
30860 7 : PyCodeObject *py_code = NULL;
30861 7 : PyObject *py_funcname = NULL;
30862 : #if PY_MAJOR_VERSION < 3
30863 : PyObject *py_srcfile = NULL;
30864 : py_srcfile = PyString_FromString(filename);
30865 : if (!py_srcfile) goto bad;
30866 : #endif
30867 7 : if (c_line) {
30868 : #if PY_MAJOR_VERSION < 3
30869 : py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
30870 : if (!py_funcname) goto bad;
30871 : #else
30872 0 : py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
30873 0 : if (!py_funcname) goto bad;
30874 0 : funcname = PyUnicode_AsUTF8(py_funcname);
30875 0 : if (!funcname) goto bad;
30876 : #endif
30877 : }
30878 : else {
30879 : #if PY_MAJOR_VERSION < 3
30880 : py_funcname = PyString_FromString(funcname);
30881 : if (!py_funcname) goto bad;
30882 : #endif
30883 7 : }
30884 : #if PY_MAJOR_VERSION < 3
30885 : py_code = __Pyx_PyCode_New(
30886 : 0,
30887 : 0,
30888 : 0,
30889 : 0,
30890 : 0,
30891 : 0,
30892 : __pyx_empty_bytes, /*PyObject *code,*/
30893 : __pyx_empty_tuple, /*PyObject *consts,*/
30894 : __pyx_empty_tuple, /*PyObject *names,*/
30895 : __pyx_empty_tuple, /*PyObject *varnames,*/
30896 : __pyx_empty_tuple, /*PyObject *freevars,*/
30897 : __pyx_empty_tuple, /*PyObject *cellvars,*/
30898 : py_srcfile, /*PyObject *filename,*/
30899 : py_funcname, /*PyObject *name,*/
30900 : py_line,
30901 : __pyx_empty_bytes /*PyObject *lnotab*/
30902 : );
30903 : Py_DECREF(py_srcfile);
30904 : #else
30905 7 : py_code = PyCode_NewEmpty(filename, funcname, py_line);
30906 : #endif
30907 7 : Py_XDECREF(py_funcname);
30908 7 : return py_code;
30909 0 : bad:
30910 0 : Py_XDECREF(py_funcname);
30911 : #if PY_MAJOR_VERSION < 3
30912 : Py_XDECREF(py_srcfile);
30913 : #endif
30914 0 : return NULL;
30915 : }
30916 20 : static void __Pyx_AddTraceback(const char *funcname, int c_line,
30917 : int py_line, const char *filename) {
30918 20 : PyCodeObject *py_code = 0;
30919 20 : PyFrameObject *py_frame = 0;
30920 20 : PyThreadState *tstate = __Pyx_PyThreadState_Current;
30921 20 : PyObject *ptype, *pvalue, *ptraceback;
30922 20 : if (c_line) {
30923 20 : c_line = __Pyx_CLineForTraceback(tstate, c_line);
30924 : }
30925 40 : py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
30926 20 : if (!py_code) {
30927 7 : __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
30928 7 : py_code = __Pyx_CreateCodeObjectForTraceback(
30929 : funcname, c_line, py_line, filename);
30930 7 : if (!py_code) {
30931 : /* If the code object creation fails, then we should clear the
30932 : fetched exception references and propagate the new exception */
30933 0 : Py_XDECREF(ptype);
30934 0 : Py_XDECREF(pvalue);
30935 0 : Py_XDECREF(ptraceback);
30936 0 : goto bad;
30937 : }
30938 7 : __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
30939 7 : __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
30940 : }
30941 40 : py_frame = PyFrame_New(
30942 : tstate, /*PyThreadState *tstate,*/
30943 : py_code, /*PyCodeObject *code,*/
30944 20 : __pyx_d, /*PyObject *globals,*/
30945 : 0 /*PyObject *locals*/
30946 : );
30947 20 : if (!py_frame) goto bad;
30948 20 : __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
30949 20 : PyTraceBack_Here(py_frame);
30950 20 : bad:
30951 20 : Py_XDECREF(py_code);
30952 20 : Py_XDECREF(py_frame);
30953 20 : }
30954 : #endif
30955 :
30956 : #if PY_MAJOR_VERSION < 3
30957 : static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
30958 : __Pyx_TypeName obj_type_name;
30959 : if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
30960 : if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
30961 : if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
30962 : obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
30963 : PyErr_Format(PyExc_TypeError,
30964 : "'" __Pyx_FMT_TYPENAME "' does not have the buffer interface",
30965 : obj_type_name);
30966 : __Pyx_DECREF_TypeName(obj_type_name);
30967 : return -1;
30968 : }
30969 : static void __Pyx_ReleaseBuffer(Py_buffer *view) {
30970 : PyObject *obj = view->obj;
30971 : if (!obj) return;
30972 : if (PyObject_CheckBuffer(obj)) {
30973 : PyBuffer_Release(view);
30974 : return;
30975 : }
30976 : if ((0)) {}
30977 : view->obj = NULL;
30978 : Py_DECREF(obj);
30979 : }
30980 : #endif
30981 :
30982 :
30983 : /* MemviewSliceIsContig */
30984 : static int
30985 0 : __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
30986 : {
30987 0 : int i, index, step, start;
30988 0 : Py_ssize_t itemsize = mvs.memview->view.itemsize;
30989 0 : if (order == 'F') {
30990 : step = 1;
30991 : start = 0;
30992 : } else {
30993 0 : step = -1;
30994 0 : start = ndim - 1;
30995 : }
30996 0 : for (i = 0; i < ndim; i++) {
30997 0 : index = start + step * i;
30998 0 : if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
30999 : return 0;
31000 0 : itemsize *= mvs.shape[index];
31001 : }
31002 : return 1;
31003 : }
31004 :
31005 : /* OverlappingSlices */
31006 : static void
31007 0 : __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
31008 : void **out_start, void **out_end,
31009 : int ndim, size_t itemsize)
31010 : {
31011 0 : char *start, *end;
31012 0 : int i;
31013 0 : start = end = slice->data;
31014 0 : for (i = 0; i < ndim; i++) {
31015 0 : Py_ssize_t stride = slice->strides[i];
31016 0 : Py_ssize_t extent = slice->shape[i];
31017 0 : if (extent == 0) {
31018 0 : *out_start = *out_end = start;
31019 0 : return;
31020 : } else {
31021 0 : if (stride > 0)
31022 0 : end += stride * (extent - 1);
31023 : else
31024 0 : start += stride * (extent - 1);
31025 : }
31026 : }
31027 0 : *out_start = start;
31028 0 : *out_end = end + itemsize;
31029 : }
31030 : static int
31031 0 : __pyx_slices_overlap(__Pyx_memviewslice *slice1,
31032 : __Pyx_memviewslice *slice2,
31033 : int ndim, size_t itemsize)
31034 : {
31035 0 : void *start1, *end1, *start2, *end2;
31036 0 : __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
31037 0 : __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
31038 0 : return (start1 < end2) && (start2 < end1);
31039 : }
31040 :
31041 : /* IsLittleEndian */
31042 0 : static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
31043 : {
31044 0 : union {
31045 : uint32_t u32;
31046 : uint8_t u8[4];
31047 : } S;
31048 0 : S.u32 = 0x01020304;
31049 0 : return S.u8[0] == 4;
31050 : }
31051 :
31052 : /* BufferFormatCheck */
31053 634 : static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
31054 : __Pyx_BufFmt_StackElem* stack,
31055 : __Pyx_TypeInfo* type) {
31056 634 : stack[0].field = &ctx->root;
31057 634 : stack[0].parent_offset = 0;
31058 634 : ctx->root.type = type;
31059 634 : ctx->root.name = "buffer dtype";
31060 634 : ctx->root.offset = 0;
31061 634 : ctx->head = stack;
31062 634 : ctx->head->field = &ctx->root;
31063 634 : ctx->fmt_offset = 0;
31064 634 : ctx->head->parent_offset = 0;
31065 634 : ctx->new_packmode = '@';
31066 634 : ctx->enc_packmode = '@';
31067 634 : ctx->new_count = 1;
31068 634 : ctx->enc_count = 0;
31069 634 : ctx->enc_type = 0;
31070 634 : ctx->is_complex = 0;
31071 634 : ctx->is_valid_array = 0;
31072 634 : ctx->struct_alignment = 0;
31073 634 : while (type->typegroup == 'S') {
31074 0 : ++ctx->head;
31075 0 : ctx->head->field = type->fields;
31076 0 : ctx->head->parent_offset = 0;
31077 0 : type = type->fields->type;
31078 : }
31079 634 : }
31080 0 : static int __Pyx_BufFmt_ParseNumber(const char** ts) {
31081 0 : int count;
31082 0 : const char* t = *ts;
31083 0 : if (*t < '0' || *t > '9') {
31084 : return -1;
31085 : } else {
31086 0 : count = *t++ - '0';
31087 0 : while (*t >= '0' && *t <= '9') {
31088 0 : count *= 10;
31089 0 : count += *t++ - '0';
31090 : }
31091 : }
31092 0 : *ts = t;
31093 0 : return count;
31094 : }
31095 0 : static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
31096 0 : int number = __Pyx_BufFmt_ParseNumber(ts);
31097 0 : if (number == -1)
31098 0 : PyErr_Format(PyExc_ValueError,\
31099 0 : "Does not understand character buffer dtype format string ('%c')", **ts);
31100 0 : return number;
31101 : }
31102 0 : static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
31103 0 : PyErr_Format(PyExc_ValueError,
31104 : "Unexpected format string character: '%c'", ch);
31105 : }
31106 1 : static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
31107 1 : switch (ch) {
31108 : case '?': return "'bool'";
31109 0 : case 'c': return "'char'";
31110 0 : case 'b': return "'signed char'";
31111 0 : case 'B': return "'unsigned char'";
31112 0 : case 'h': return "'short'";
31113 0 : case 'H': return "'unsigned short'";
31114 0 : case 'i': return "'int'";
31115 0 : case 'I': return "'unsigned int'";
31116 1 : case 'l': return "'long'";
31117 0 : case 'L': return "'unsigned long'";
31118 0 : case 'q': return "'long long'";
31119 0 : case 'Q': return "'unsigned long long'";
31120 0 : case 'f': return (is_complex ? "'complex float'" : "'float'");
31121 0 : case 'd': return (is_complex ? "'complex double'" : "'double'");
31122 0 : case 'g': return (is_complex ? "'complex long double'" : "'long double'");
31123 0 : case 'T': return "a struct";
31124 0 : case 'O': return "Python object";
31125 0 : case 'P': return "a pointer";
31126 0 : case 's': case 'p': return "a string";
31127 0 : case 0: return "end";
31128 0 : default: return "unparsable format string";
31129 : }
31130 : }
31131 0 : static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
31132 0 : switch (ch) {
31133 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31134 0 : case 'h': case 'H': return 2;
31135 : case 'i': case 'I': case 'l': case 'L': return 4;
31136 : case 'q': case 'Q': return 8;
31137 0 : case 'f': return (is_complex ? 8 : 4);
31138 0 : case 'd': return (is_complex ? 16 : 8);
31139 0 : case 'g': {
31140 0 : PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
31141 0 : return 0;
31142 : }
31143 : case 'O': case 'P': return sizeof(void*);
31144 0 : default:
31145 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31146 0 : return 0;
31147 : }
31148 : }
31149 634 : static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
31150 634 : switch (ch) {
31151 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31152 0 : case 'h': case 'H': return sizeof(short);
31153 : case 'i': case 'I': return sizeof(int);
31154 : case 'l': case 'L': return sizeof(long);
31155 : #ifdef HAVE_LONG_LONG
31156 : case 'q': case 'Q': return sizeof(PY_LONG_LONG);
31157 : #endif
31158 0 : case 'f': return sizeof(float) * (is_complex ? 2 : 1);
31159 284 : case 'd': return sizeof(double) * (is_complex ? 2 : 1);
31160 0 : case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
31161 : case 'O': case 'P': return sizeof(void*);
31162 0 : default: {
31163 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31164 0 : return 0;
31165 : }
31166 : }
31167 : }
31168 : typedef struct { char c; short x; } __Pyx_st_short;
31169 : typedef struct { char c; int x; } __Pyx_st_int;
31170 : typedef struct { char c; long x; } __Pyx_st_long;
31171 : typedef struct { char c; float x; } __Pyx_st_float;
31172 : typedef struct { char c; double x; } __Pyx_st_double;
31173 : typedef struct { char c; long double x; } __Pyx_st_longdouble;
31174 : typedef struct { char c; void *x; } __Pyx_st_void_p;
31175 : #ifdef HAVE_LONG_LONG
31176 : typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
31177 : #endif
31178 634 : static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, int is_complex) {
31179 634 : CYTHON_UNUSED_VAR(is_complex);
31180 634 : switch (ch) {
31181 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31182 0 : case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
31183 : case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
31184 : case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
31185 : #ifdef HAVE_LONG_LONG
31186 : case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
31187 : #endif
31188 : case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
31189 : case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
31190 0 : case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
31191 : case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
31192 0 : default:
31193 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31194 0 : return 0;
31195 : }
31196 : }
31197 : /* These are for computing the padding at the end of the struct to align
31198 : on the first member of the struct. This will probably the same as above,
31199 : but we don't have any guarantees.
31200 : */
31201 : typedef struct { short x; char c; } __Pyx_pad_short;
31202 : typedef struct { int x; char c; } __Pyx_pad_int;
31203 : typedef struct { long x; char c; } __Pyx_pad_long;
31204 : typedef struct { float x; char c; } __Pyx_pad_float;
31205 : typedef struct { double x; char c; } __Pyx_pad_double;
31206 : typedef struct { long double x; char c; } __Pyx_pad_longdouble;
31207 : typedef struct { void *x; char c; } __Pyx_pad_void_p;
31208 : #ifdef HAVE_LONG_LONG
31209 : typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
31210 : #endif
31211 634 : static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, int is_complex) {
31212 634 : CYTHON_UNUSED_VAR(is_complex);
31213 634 : switch (ch) {
31214 : case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
31215 0 : case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
31216 : case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
31217 : case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
31218 : #ifdef HAVE_LONG_LONG
31219 : case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
31220 : #endif
31221 : case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
31222 : case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
31223 0 : case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
31224 : case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
31225 0 : default:
31226 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31227 0 : return 0;
31228 : }
31229 : }
31230 634 : static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
31231 634 : switch (ch) {
31232 : case 'c':
31233 : return 'H';
31234 346 : case 'b': case 'h': case 'i':
31235 : case 'l': case 'q': case 's': case 'p':
31236 346 : return 'I';
31237 4 : case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
31238 4 : return 'U';
31239 284 : case 'f': case 'd': case 'g':
31240 284 : return (is_complex ? 'C' : 'R');
31241 0 : case 'O':
31242 0 : return 'O';
31243 0 : case 'P':
31244 0 : return 'P';
31245 0 : default: {
31246 0 : __Pyx_BufFmt_RaiseUnexpectedChar(ch);
31247 0 : return 0;
31248 : }
31249 : }
31250 : }
31251 1 : static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
31252 2 : if (ctx->head == NULL || ctx->head->field == &ctx->root) {
31253 1 : const char* expected;
31254 1 : const char* quote;
31255 1 : if (ctx->head == NULL) {
31256 : expected = "end";
31257 : quote = "";
31258 : } else {
31259 1 : expected = ctx->head->field->type->name;
31260 1 : quote = "'";
31261 : }
31262 1 : PyErr_Format(PyExc_ValueError,
31263 : "Buffer dtype mismatch, expected %s%s%s but got %s",
31264 : quote, expected, quote,
31265 1 : __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
31266 : } else {
31267 0 : __Pyx_StructField* field = ctx->head->field;
31268 0 : __Pyx_StructField* parent = (ctx->head - 1)->field;
31269 0 : PyErr_Format(PyExc_ValueError,
31270 : "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
31271 0 : field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
31272 0 : parent->type->name, field->name);
31273 : }
31274 1 : }
31275 1268 : static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
31276 1268 : char group;
31277 1268 : size_t size, offset, arraysize = 1;
31278 1268 : if (ctx->enc_type == 0) return 0;
31279 634 : if (ctx->head->field->type->arraysize[0]) {
31280 0 : int i, ndim = 0;
31281 0 : if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
31282 0 : ctx->is_valid_array = ctx->head->field->type->ndim == 1;
31283 0 : ndim = 1;
31284 0 : if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
31285 0 : PyErr_Format(PyExc_ValueError,
31286 : "Expected a dimension of size %zu, got %zu",
31287 : ctx->head->field->type->arraysize[0], ctx->enc_count);
31288 0 : return -1;
31289 : }
31290 : }
31291 0 : if (!ctx->is_valid_array) {
31292 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
31293 : ctx->head->field->type->ndim, ndim);
31294 0 : return -1;
31295 : }
31296 0 : for (i = 0; i < ctx->head->field->type->ndim; i++) {
31297 0 : arraysize *= ctx->head->field->type->arraysize[i];
31298 : }
31299 0 : ctx->is_valid_array = 0;
31300 0 : ctx->enc_count = 1;
31301 : }
31302 634 : group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
31303 634 : do {
31304 634 : __Pyx_StructField* field = ctx->head->field;
31305 634 : __Pyx_TypeInfo* type = field->type;
31306 634 : if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
31307 634 : size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
31308 : } else {
31309 0 : size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
31310 : }
31311 634 : if (ctx->enc_packmode == '@') {
31312 634 : size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
31313 634 : size_t align_mod_offset;
31314 634 : if (align_at == 0) return -1;
31315 634 : align_mod_offset = ctx->fmt_offset % align_at;
31316 634 : if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
31317 634 : if (ctx->struct_alignment == 0)
31318 634 : ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
31319 : ctx->is_complex);
31320 : }
31321 634 : if (type->size != size || type->typegroup != group) {
31322 1 : if (type->typegroup == 'C' && type->fields != NULL) {
31323 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
31324 0 : ++ctx->head;
31325 0 : ctx->head->field = type->fields;
31326 0 : ctx->head->parent_offset = parent_offset;
31327 0 : continue;
31328 : }
31329 1 : if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
31330 : } else {
31331 1 : __Pyx_BufFmt_RaiseExpected(ctx);
31332 1 : return -1;
31333 : }
31334 : }
31335 633 : offset = ctx->head->parent_offset + field->offset;
31336 633 : if (ctx->fmt_offset != offset) {
31337 0 : PyErr_Format(PyExc_ValueError,
31338 : "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
31339 : (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
31340 0 : return -1;
31341 : }
31342 633 : ctx->fmt_offset += size;
31343 633 : if (arraysize)
31344 633 : ctx->fmt_offset += (arraysize - 1) * size;
31345 633 : --ctx->enc_count;
31346 633 : while (1) {
31347 633 : if (field == &ctx->root) {
31348 633 : ctx->head = NULL;
31349 633 : if (ctx->enc_count != 0) {
31350 0 : __Pyx_BufFmt_RaiseExpected(ctx);
31351 0 : return -1;
31352 : }
31353 : break;
31354 : }
31355 0 : ctx->head->field = ++field;
31356 0 : if (field->type == NULL) {
31357 0 : --ctx->head;
31358 0 : field = ctx->head->field;
31359 0 : continue;
31360 0 : } else if (field->type->typegroup == 'S') {
31361 0 : size_t parent_offset = ctx->head->parent_offset + field->offset;
31362 0 : if (field->type->fields->type == NULL) continue;
31363 0 : field = field->type->fields;
31364 0 : ++ctx->head;
31365 0 : ctx->head->field = field;
31366 0 : ctx->head->parent_offset = parent_offset;
31367 0 : break;
31368 : } else {
31369 : break;
31370 : }
31371 : }
31372 633 : } while (ctx->enc_count);
31373 633 : ctx->enc_type = 0;
31374 633 : ctx->is_complex = 0;
31375 633 : return 0;
31376 : }
31377 : static int
31378 0 : __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
31379 : {
31380 0 : const char *ts = *tsp;
31381 0 : int i = 0, number, ndim;
31382 0 : ++ts;
31383 0 : if (ctx->new_count != 1) {
31384 0 : PyErr_SetString(PyExc_ValueError,
31385 : "Cannot handle repeated arrays in format string");
31386 0 : return -1;
31387 : }
31388 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return -1;
31389 0 : ndim = ctx->head->field->type->ndim;
31390 0 : while (*ts && *ts != ')') {
31391 0 : switch (*ts) {
31392 0 : case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
31393 0 : default: break;
31394 : }
31395 0 : number = __Pyx_BufFmt_ExpectNumber(&ts);
31396 0 : if (number == -1) return -1;
31397 0 : if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i]) {
31398 0 : PyErr_Format(PyExc_ValueError,
31399 : "Expected a dimension of size %zu, got %d",
31400 : ctx->head->field->type->arraysize[i], number);
31401 0 : return -1;
31402 : }
31403 0 : if (*ts != ',' && *ts != ')') {
31404 0 : PyErr_Format(PyExc_ValueError,
31405 : "Expected a comma in format string, got '%c'", *ts);
31406 0 : return -1;
31407 : }
31408 0 : if (*ts == ',') ts++;
31409 0 : i++;
31410 : }
31411 0 : if (i != ndim) {
31412 0 : PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
31413 0 : ctx->head->field->type->ndim, i);
31414 0 : return -1;
31415 : }
31416 0 : if (!*ts) {
31417 0 : PyErr_SetString(PyExc_ValueError,
31418 : "Unexpected end of format string, expected ')'");
31419 0 : return -1;
31420 : }
31421 0 : ctx->is_valid_array = 1;
31422 0 : ctx->new_count = 1;
31423 0 : *tsp = ++ts;
31424 0 : return 0;
31425 : }
31426 634 : static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
31427 634 : int got_Z = 0;
31428 1268 : while (1) {
31429 1268 : switch(*ts) {
31430 634 : case 0:
31431 634 : if (ctx->enc_type != 0 && ctx->head == NULL) {
31432 0 : __Pyx_BufFmt_RaiseExpected(ctx);
31433 0 : return NULL;
31434 : }
31435 634 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31436 633 : if (ctx->head != NULL) {
31437 0 : __Pyx_BufFmt_RaiseExpected(ctx);
31438 0 : return NULL;
31439 : }
31440 : return ts;
31441 0 : case ' ':
31442 : case '\r':
31443 : case '\n':
31444 0 : ++ts;
31445 0 : break;
31446 : case '<':
31447 0 : if (!__Pyx_Is_Little_Endian()) {
31448 : PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
31449 : return NULL;
31450 : }
31451 0 : ctx->new_packmode = '=';
31452 0 : ++ts;
31453 0 : break;
31454 : case '>':
31455 : case '!':
31456 0 : if (__Pyx_Is_Little_Endian()) {
31457 0 : PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
31458 0 : return NULL;
31459 : }
31460 : ctx->new_packmode = '=';
31461 : ++ts;
31462 : break;
31463 0 : case '=':
31464 : case '@':
31465 : case '^':
31466 0 : ctx->new_packmode = *ts++;
31467 0 : break;
31468 0 : case 'T':
31469 : {
31470 0 : const char* ts_after_sub;
31471 0 : size_t i, struct_count = ctx->new_count;
31472 0 : size_t struct_alignment = ctx->struct_alignment;
31473 0 : ctx->new_count = 1;
31474 0 : ++ts;
31475 0 : if (*ts != '{') {
31476 0 : PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
31477 0 : return NULL;
31478 : }
31479 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31480 0 : ctx->enc_type = 0;
31481 0 : ctx->enc_count = 0;
31482 0 : ctx->struct_alignment = 0;
31483 0 : ++ts;
31484 0 : ts_after_sub = ts;
31485 0 : for (i = 0; i != struct_count; ++i) {
31486 0 : ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
31487 0 : if (!ts_after_sub) return NULL;
31488 : }
31489 0 : ts = ts_after_sub;
31490 0 : if (struct_alignment) ctx->struct_alignment = struct_alignment;
31491 : }
31492 : break;
31493 0 : case '}':
31494 : {
31495 0 : size_t alignment = ctx->struct_alignment;
31496 0 : ++ts;
31497 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31498 0 : ctx->enc_type = 0;
31499 0 : if (alignment && ctx->fmt_offset % alignment) {
31500 0 : ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
31501 : }
31502 : }
31503 : return ts;
31504 0 : case 'x':
31505 0 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31506 0 : ctx->fmt_offset += ctx->new_count;
31507 0 : ctx->new_count = 1;
31508 0 : ctx->enc_count = 0;
31509 0 : ctx->enc_type = 0;
31510 0 : ctx->enc_packmode = ctx->new_packmode;
31511 0 : ++ts;
31512 0 : break;
31513 0 : case 'Z':
31514 0 : got_Z = 1;
31515 0 : ++ts;
31516 0 : if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
31517 0 : __Pyx_BufFmt_RaiseUnexpectedChar('Z');
31518 0 : return NULL;
31519 : }
31520 634 : CYTHON_FALLTHROUGH;
31521 : case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
31522 : case 'l': case 'L': case 'q': case 'Q':
31523 : case 'f': case 'd': case 'g':
31524 : case 'O': case 'p':
31525 634 : if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
31526 0 : (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
31527 0 : ctx->enc_count += ctx->new_count;
31528 0 : ctx->new_count = 1;
31529 0 : got_Z = 0;
31530 0 : ++ts;
31531 0 : break;
31532 : }
31533 634 : CYTHON_FALLTHROUGH;
31534 : case 's':
31535 634 : if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
31536 634 : ctx->enc_count = ctx->new_count;
31537 634 : ctx->enc_packmode = ctx->new_packmode;
31538 634 : ctx->enc_type = *ts;
31539 634 : ctx->is_complex = got_Z;
31540 634 : ++ts;
31541 634 : ctx->new_count = 1;
31542 634 : got_Z = 0;
31543 634 : break;
31544 0 : case ':':
31545 0 : ++ts;
31546 0 : while(*ts != ':') ++ts;
31547 0 : ++ts;
31548 0 : break;
31549 0 : case '(':
31550 0 : if (__pyx_buffmt_parse_array(ctx, &ts) < 0) return NULL;
31551 : break;
31552 0 : default:
31553 : {
31554 0 : int number = __Pyx_BufFmt_ExpectNumber(&ts);
31555 0 : if (number == -1) return NULL;
31556 0 : ctx->new_count = (size_t)number;
31557 : }
31558 : }
31559 : }
31560 : }
31561 :
31562 : /* TypeInfoCompare */
31563 : static int
31564 0 : __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
31565 : {
31566 0 : int i;
31567 0 : if (!a || !b)
31568 : return 0;
31569 0 : if (a == b)
31570 : return 1;
31571 0 : if (a->size != b->size || a->typegroup != b->typegroup ||
31572 0 : a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
31573 0 : if (a->typegroup == 'H' || b->typegroup == 'H') {
31574 0 : return a->size == b->size;
31575 : } else {
31576 : return 0;
31577 : }
31578 : }
31579 0 : if (a->ndim) {
31580 0 : for (i = 0; i < a->ndim; i++)
31581 0 : if (a->arraysize[i] != b->arraysize[i])
31582 : return 0;
31583 : }
31584 0 : if (a->typegroup == 'S') {
31585 0 : if (a->flags != b->flags)
31586 : return 0;
31587 0 : if (a->fields || b->fields) {
31588 0 : if (!(a->fields && b->fields))
31589 : return 0;
31590 0 : for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
31591 0 : __Pyx_StructField *field_a = a->fields + i;
31592 0 : __Pyx_StructField *field_b = b->fields + i;
31593 0 : if (field_a->offset != field_b->offset ||
31594 0 : !__pyx_typeinfo_cmp(field_a->type, field_b->type))
31595 0 : return 0;
31596 : }
31597 0 : return !a->fields[i].type && !b->fields[i].type;
31598 : }
31599 : }
31600 : return 1;
31601 : }
31602 :
31603 : /* MemviewSliceValidateAndInit */
31604 : static int
31605 546 : __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
31606 : {
31607 546 : if (buf->shape[dim] <= 1)
31608 : return 1;
31609 288 : if (buf->strides) {
31610 288 : if (spec & __Pyx_MEMVIEW_CONTIG) {
31611 288 : if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
31612 0 : if (unlikely(buf->strides[dim] != sizeof(void *))) {
31613 0 : PyErr_Format(PyExc_ValueError,
31614 : "Buffer is not indirectly contiguous "
31615 : "in dimension %d.", dim);
31616 0 : goto fail;
31617 : }
31618 288 : } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
31619 0 : PyErr_SetString(PyExc_ValueError,
31620 : "Buffer and memoryview are not contiguous "
31621 : "in the same dimension.");
31622 0 : goto fail;
31623 : }
31624 : }
31625 288 : if (spec & __Pyx_MEMVIEW_FOLLOW) {
31626 0 : Py_ssize_t stride = buf->strides[dim];
31627 0 : if (stride < 0)
31628 : stride = -stride;
31629 0 : if (unlikely(stride < buf->itemsize)) {
31630 0 : PyErr_SetString(PyExc_ValueError,
31631 : "Buffer and memoryview are not contiguous "
31632 : "in the same dimension.");
31633 0 : goto fail;
31634 : }
31635 : }
31636 : } else {
31637 0 : if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
31638 0 : PyErr_Format(PyExc_ValueError,
31639 : "C-contiguous buffer is not contiguous in "
31640 : "dimension %d", dim);
31641 0 : goto fail;
31642 0 : } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
31643 0 : PyErr_Format(PyExc_ValueError,
31644 : "C-contiguous buffer is not indirect in "
31645 : "dimension %d", dim);
31646 0 : goto fail;
31647 0 : } else if (unlikely(buf->suboffsets)) {
31648 0 : PyErr_SetString(PyExc_ValueError,
31649 : "Buffer exposes suboffsets but no strides");
31650 0 : goto fail;
31651 : }
31652 : }
31653 : return 1;
31654 : fail:
31655 : return 0;
31656 : }
31657 : static int
31658 546 : __pyx_check_suboffsets(Py_buffer *buf, int dim, int ndim, int spec)
31659 : {
31660 546 : CYTHON_UNUSED_VAR(ndim);
31661 546 : if (spec & __Pyx_MEMVIEW_DIRECT) {
31662 546 : if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
31663 0 : PyErr_Format(PyExc_ValueError,
31664 : "Buffer not compatible with direct access "
31665 : "in dimension %d.", dim);
31666 0 : goto fail;
31667 : }
31668 : }
31669 546 : if (spec & __Pyx_MEMVIEW_PTR) {
31670 0 : if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
31671 0 : PyErr_Format(PyExc_ValueError,
31672 : "Buffer is not indirectly accessible "
31673 : "in dimension %d.", dim);
31674 0 : goto fail;
31675 : }
31676 : }
31677 : return 1;
31678 : fail:
31679 : return 0;
31680 : }
31681 : static int
31682 546 : __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
31683 : {
31684 546 : int i;
31685 546 : if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
31686 : Py_ssize_t stride = 1;
31687 0 : for (i = 0; i < ndim; i++) {
31688 0 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
31689 0 : PyErr_SetString(PyExc_ValueError,
31690 : "Buffer not fortran contiguous.");
31691 0 : goto fail;
31692 : }
31693 0 : stride = stride * buf->shape[i];
31694 : }
31695 546 : } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
31696 546 : Py_ssize_t stride = 1;
31697 1092 : for (i = ndim - 1; i >- 1; i--) {
31698 546 : if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
31699 0 : PyErr_SetString(PyExc_ValueError,
31700 : "Buffer not C contiguous.");
31701 0 : goto fail;
31702 : }
31703 546 : stride = stride * buf->shape[i];
31704 : }
31705 : }
31706 : return 1;
31707 : fail:
31708 : return 0;
31709 : }
31710 636 : static int __Pyx_ValidateAndInit_memviewslice(
31711 : int *axes_specs,
31712 : int c_or_f_flag,
31713 : int buf_flags,
31714 : int ndim,
31715 : __Pyx_TypeInfo *dtype,
31716 : __Pyx_BufFmt_StackElem stack[],
31717 : __Pyx_memviewslice *memviewslice,
31718 : PyObject *original_obj)
31719 : {
31720 636 : struct __pyx_memoryview_obj *memview, *new_memview;
31721 : __Pyx_RefNannyDeclarations
31722 636 : Py_buffer *buf;
31723 636 : int i, spec = 0, retval = -1;
31724 636 : __Pyx_BufFmt_Context ctx;
31725 636 : int from_memoryview = __pyx_memoryview_check(original_obj);
31726 636 : __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
31727 636 : if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
31728 : original_obj)->typeinfo)) {
31729 : memview = (struct __pyx_memoryview_obj *) original_obj;
31730 : new_memview = NULL;
31731 : } else {
31732 636 : memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
31733 : original_obj, buf_flags, 0, dtype);
31734 636 : new_memview = memview;
31735 636 : if (unlikely(!memview))
31736 1 : goto fail;
31737 : }
31738 635 : buf = &memview->view;
31739 635 : if (unlikely(buf->ndim != ndim)) {
31740 1 : PyErr_Format(PyExc_ValueError,
31741 : "Buffer has wrong number of dimensions (expected %d, got %d)",
31742 : ndim, buf->ndim);
31743 1 : goto fail;
31744 : }
31745 634 : if (new_memview) {
31746 634 : __Pyx_BufFmt_Init(&ctx, stack, dtype);
31747 634 : if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
31748 : }
31749 633 : if (unlikely((unsigned) buf->itemsize != dtype->size)) {
31750 0 : PyErr_Format(PyExc_ValueError,
31751 : "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
31752 : "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
31753 : buf->itemsize,
31754 : (buf->itemsize > 1) ? "s" : "",
31755 : dtype->name,
31756 : dtype->size,
31757 : (dtype->size > 1) ? "s" : "");
31758 0 : goto fail;
31759 : }
31760 633 : if (buf->len > 0) {
31761 1092 : for (i = 0; i < ndim; i++) {
31762 546 : spec = axes_specs[i];
31763 546 : if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
31764 0 : goto fail;
31765 546 : if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
31766 0 : goto fail;
31767 : }
31768 546 : if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
31769 0 : goto fail;
31770 : }
31771 633 : if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
31772 : new_memview != NULL) == -1)) {
31773 0 : goto fail;
31774 : }
31775 633 : retval = 0;
31776 633 : goto no_fail;
31777 3 : fail:
31778 3 : Py_XDECREF(new_memview);
31779 3 : retval = -1;
31780 636 : no_fail:
31781 636 : __Pyx_RefNannyFinishContext();
31782 636 : return retval;
31783 : }
31784 :
31785 : /* ObjectToMemviewSlice */
31786 150 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t__const__(PyObject *obj, int writable_flag) {
31787 150 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
31788 150 : __Pyx_BufFmt_StackElem stack[1];
31789 150 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
31790 150 : int retcode;
31791 150 : if (obj == Py_None) {
31792 2 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
31793 2 : return result;
31794 : }
31795 148 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
31796 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
31797 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t__const__, stack,
31798 : &result, obj);
31799 148 : if (unlikely(retcode == -1))
31800 3 : goto __pyx_fail;
31801 145 : return result;
31802 3 : __pyx_fail:
31803 3 : result.memview = NULL;
31804 3 : result.data = NULL;
31805 3 : return result;
31806 : }
31807 :
31808 : /* ObjectToMemviewSlice */
31809 138 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t__const__(PyObject *obj, int writable_flag) {
31810 138 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
31811 138 : __Pyx_BufFmt_StackElem stack[1];
31812 138 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
31813 138 : int retcode;
31814 138 : if (obj == Py_None) {
31815 2 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
31816 2 : return result;
31817 : }
31818 136 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
31819 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
31820 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t__const__, stack,
31821 : &result, obj);
31822 136 : if (unlikely(retcode == -1))
31823 0 : goto __pyx_fail;
31824 136 : return result;
31825 0 : __pyx_fail:
31826 0 : result.memview = NULL;
31827 0 : result.data = NULL;
31828 0 : return result;
31829 : }
31830 :
31831 : /* CIntFromPyVerify */
31832 : #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
31833 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
31834 : #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
31835 : __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
31836 : #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
31837 : {\
31838 : func_type value = func_value;\
31839 : if (sizeof(target_type) < sizeof(func_type)) {\
31840 : if (unlikely(value != (func_type) (target_type) value)) {\
31841 : func_type zero = 0;\
31842 : if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
31843 : return (target_type) -1;\
31844 : if (is_unsigned && unlikely(value < zero))\
31845 : goto raise_neg_overflow;\
31846 : else\
31847 : goto raise_overflow;\
31848 : }\
31849 : }\
31850 : return (target_type) value;\
31851 : }
31852 :
31853 : /* ObjectToMemviewSlice */
31854 209 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_intp_t(PyObject *obj, int writable_flag) {
31855 209 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
31856 209 : __Pyx_BufFmt_StackElem stack[1];
31857 209 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
31858 209 : int retcode;
31859 209 : if (obj == Py_None) {
31860 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
31861 0 : return result;
31862 : }
31863 209 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
31864 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
31865 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_intp_t, stack,
31866 : &result, obj);
31867 209 : if (unlikely(retcode == -1))
31868 0 : goto __pyx_fail;
31869 209 : return result;
31870 0 : __pyx_fail:
31871 0 : result.memview = NULL;
31872 0 : result.data = NULL;
31873 0 : return result;
31874 : }
31875 :
31876 : /* MemviewDtypeToObject */
31877 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_intp_t(const char *itemp) {
31878 0 : return (PyObject *) __Pyx_PyInt_From_npy_intp(*(__pyx_t_5numpy_intp_t *) itemp);
31879 : }
31880 0 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_intp_t(const char *itemp, PyObject *obj) {
31881 0 : __pyx_t_5numpy_intp_t value = __Pyx_PyInt_As_npy_intp(obj);
31882 0 : if (unlikely((value == ((npy_intp)-1)) && PyErr_Occurred()))
31883 : return 0;
31884 0 : *(__pyx_t_5numpy_intp_t *) itemp = value;
31885 0 : return 1;
31886 : }
31887 :
31888 : /* ObjectToMemviewSlice */
31889 4 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_uint8_t(PyObject *obj, int writable_flag) {
31890 4 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
31891 4 : __Pyx_BufFmt_StackElem stack[1];
31892 4 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
31893 4 : int retcode;
31894 4 : if (obj == Py_None) {
31895 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
31896 0 : return result;
31897 : }
31898 4 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
31899 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
31900 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, stack,
31901 : &result, obj);
31902 4 : if (unlikely(retcode == -1))
31903 0 : goto __pyx_fail;
31904 4 : return result;
31905 0 : __pyx_fail:
31906 0 : result.memview = NULL;
31907 0 : result.data = NULL;
31908 0 : return result;
31909 : }
31910 :
31911 : /* MemviewDtypeToObject */
31912 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t__const__(const char *itemp) {
31913 0 : return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t const *) itemp);
31914 : }
31915 :
31916 : /* MemviewDtypeToObject */
31917 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_uint8_t(const char *itemp) {
31918 0 : return (PyObject *) __Pyx_PyInt_From_npy_uint8(*(__pyx_t_5numpy_uint8_t *) itemp);
31919 : }
31920 0 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_uint8_t(const char *itemp, PyObject *obj) {
31921 0 : __pyx_t_5numpy_uint8_t value = __Pyx_PyInt_As_npy_uint8(obj);
31922 0 : if (unlikely((value == ((npy_uint8)-1)) && PyErr_Occurred()))
31923 : return 0;
31924 0 : *(__pyx_t_5numpy_uint8_t *) itemp = value;
31925 0 : return 1;
31926 : }
31927 :
31928 : /* ObjectToMemviewSlice */
31929 139 : static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_float64_t(PyObject *obj, int writable_flag) {
31930 139 : __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
31931 139 : __Pyx_BufFmt_StackElem stack[1];
31932 139 : int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
31933 139 : int retcode;
31934 139 : if (obj == Py_None) {
31935 0 : result.memview = (struct __pyx_memoryview_obj *) Py_None;
31936 0 : return result;
31937 : }
31938 139 : retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
31939 : (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 1,
31940 : &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, stack,
31941 : &result, obj);
31942 139 : if (unlikely(retcode == -1))
31943 0 : goto __pyx_fail;
31944 139 : return result;
31945 0 : __pyx_fail:
31946 0 : result.memview = NULL;
31947 0 : result.data = NULL;
31948 0 : return result;
31949 : }
31950 :
31951 : /* MemviewDtypeToObject */
31952 0 : static CYTHON_INLINE PyObject *__pyx_memview_get_nn___pyx_t_5numpy_float64_t(const char *itemp) {
31953 0 : return (PyObject *) PyFloat_FromDouble(*(__pyx_t_5numpy_float64_t *) itemp);
31954 : }
31955 0 : static CYTHON_INLINE int __pyx_memview_set_nn___pyx_t_5numpy_float64_t(const char *itemp, PyObject *obj) {
31956 0 : __pyx_t_5numpy_float64_t value = __pyx_PyFloat_AsDouble(obj);
31957 0 : if (unlikely((value == ((npy_float64)-1)) && PyErr_Occurred()))
31958 : return 0;
31959 0 : *(__pyx_t_5numpy_float64_t *) itemp = value;
31960 0 : return 1;
31961 : }
31962 :
31963 : /* Declarations */
31964 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
31965 : #ifdef __cplusplus
31966 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31967 : return ::std::complex< float >(x, y);
31968 : }
31969 : #else
31970 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31971 : return x + y*(__pyx_t_float_complex)_Complex_I;
31972 : }
31973 : #endif
31974 : #else
31975 : static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
31976 : __pyx_t_float_complex z;
31977 : z.real = x;
31978 : z.imag = y;
31979 : return z;
31980 : }
31981 : #endif
31982 :
31983 : /* Arithmetic */
31984 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
31985 : #else
31986 : static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31987 : return (a.real == b.real) && (a.imag == b.imag);
31988 : }
31989 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31990 : __pyx_t_float_complex z;
31991 : z.real = a.real + b.real;
31992 : z.imag = a.imag + b.imag;
31993 : return z;
31994 : }
31995 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
31996 : __pyx_t_float_complex z;
31997 : z.real = a.real - b.real;
31998 : z.imag = a.imag - b.imag;
31999 : return z;
32000 : }
32001 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
32002 : __pyx_t_float_complex z;
32003 : z.real = a.real * b.real - a.imag * b.imag;
32004 : z.imag = a.real * b.imag + a.imag * b.real;
32005 : return z;
32006 : }
32007 : #if 1
32008 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
32009 : if (b.imag == 0) {
32010 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
32011 : } else if (fabsf(b.real) >= fabsf(b.imag)) {
32012 : if (b.real == 0 && b.imag == 0) {
32013 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
32014 : } else {
32015 : float r = b.imag / b.real;
32016 : float s = (float)(1.0) / (b.real + b.imag * r);
32017 : return __pyx_t_float_complex_from_parts(
32018 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
32019 : }
32020 : } else {
32021 : float r = b.real / b.imag;
32022 : float s = (float)(1.0) / (b.imag + b.real * r);
32023 : return __pyx_t_float_complex_from_parts(
32024 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
32025 : }
32026 : }
32027 : #else
32028 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
32029 : if (b.imag == 0) {
32030 : return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
32031 : } else {
32032 : float denom = b.real * b.real + b.imag * b.imag;
32033 : return __pyx_t_float_complex_from_parts(
32034 : (a.real * b.real + a.imag * b.imag) / denom,
32035 : (a.imag * b.real - a.real * b.imag) / denom);
32036 : }
32037 : }
32038 : #endif
32039 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
32040 : __pyx_t_float_complex z;
32041 : z.real = -a.real;
32042 : z.imag = -a.imag;
32043 : return z;
32044 : }
32045 : static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
32046 : return (a.real == 0) && (a.imag == 0);
32047 : }
32048 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
32049 : __pyx_t_float_complex z;
32050 : z.real = a.real;
32051 : z.imag = -a.imag;
32052 : return z;
32053 : }
32054 : #if 1
32055 : static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
32056 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32057 : return sqrtf(z.real*z.real + z.imag*z.imag);
32058 : #else
32059 : return hypotf(z.real, z.imag);
32060 : #endif
32061 : }
32062 : static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
32063 : __pyx_t_float_complex z;
32064 : float r, lnr, theta, z_r, z_theta;
32065 : if (b.imag == 0 && b.real == (int)b.real) {
32066 : if (b.real < 0) {
32067 : float denom = a.real * a.real + a.imag * a.imag;
32068 : a.real = a.real / denom;
32069 : a.imag = -a.imag / denom;
32070 : b.real = -b.real;
32071 : }
32072 : switch ((int)b.real) {
32073 : case 0:
32074 : z.real = 1;
32075 : z.imag = 0;
32076 : return z;
32077 : case 1:
32078 : return a;
32079 : case 2:
32080 : return __Pyx_c_prod_float(a, a);
32081 : case 3:
32082 : z = __Pyx_c_prod_float(a, a);
32083 : return __Pyx_c_prod_float(z, a);
32084 : case 4:
32085 : z = __Pyx_c_prod_float(a, a);
32086 : return __Pyx_c_prod_float(z, z);
32087 : }
32088 : }
32089 : if (a.imag == 0) {
32090 : if (a.real == 0) {
32091 : return a;
32092 : } else if ((b.imag == 0) && (a.real >= 0)) {
32093 : z.real = powf(a.real, b.real);
32094 : z.imag = 0;
32095 : return z;
32096 : } else if (a.real > 0) {
32097 : r = a.real;
32098 : theta = 0;
32099 : } else {
32100 : r = -a.real;
32101 : theta = atan2f(0.0, -1.0);
32102 : }
32103 : } else {
32104 : r = __Pyx_c_abs_float(a);
32105 : theta = atan2f(a.imag, a.real);
32106 : }
32107 : lnr = logf(r);
32108 : z_r = expf(lnr * b.real - theta * b.imag);
32109 : z_theta = theta * b.real + lnr * b.imag;
32110 : z.real = z_r * cosf(z_theta);
32111 : z.imag = z_r * sinf(z_theta);
32112 : return z;
32113 : }
32114 : #endif
32115 : #endif
32116 :
32117 : /* Declarations */
32118 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32119 : #ifdef __cplusplus
32120 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
32121 : return ::std::complex< double >(x, y);
32122 : }
32123 : #else
32124 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
32125 : return x + y*(__pyx_t_double_complex)_Complex_I;
32126 : }
32127 : #endif
32128 : #else
32129 : static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
32130 : __pyx_t_double_complex z;
32131 : z.real = x;
32132 : z.imag = y;
32133 : return z;
32134 : }
32135 : #endif
32136 :
32137 : /* Arithmetic */
32138 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32139 : #else
32140 : static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32141 : return (a.real == b.real) && (a.imag == b.imag);
32142 : }
32143 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32144 : __pyx_t_double_complex z;
32145 : z.real = a.real + b.real;
32146 : z.imag = a.imag + b.imag;
32147 : return z;
32148 : }
32149 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32150 : __pyx_t_double_complex z;
32151 : z.real = a.real - b.real;
32152 : z.imag = a.imag - b.imag;
32153 : return z;
32154 : }
32155 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32156 : __pyx_t_double_complex z;
32157 : z.real = a.real * b.real - a.imag * b.imag;
32158 : z.imag = a.real * b.imag + a.imag * b.real;
32159 : return z;
32160 : }
32161 : #if 1
32162 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32163 : if (b.imag == 0) {
32164 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32165 : } else if (fabs(b.real) >= fabs(b.imag)) {
32166 : if (b.real == 0 && b.imag == 0) {
32167 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
32168 : } else {
32169 : double r = b.imag / b.real;
32170 : double s = (double)(1.0) / (b.real + b.imag * r);
32171 : return __pyx_t_double_complex_from_parts(
32172 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
32173 : }
32174 : } else {
32175 : double r = b.real / b.imag;
32176 : double s = (double)(1.0) / (b.imag + b.real * r);
32177 : return __pyx_t_double_complex_from_parts(
32178 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
32179 : }
32180 : }
32181 : #else
32182 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32183 : if (b.imag == 0) {
32184 : return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32185 : } else {
32186 : double denom = b.real * b.real + b.imag * b.imag;
32187 : return __pyx_t_double_complex_from_parts(
32188 : (a.real * b.real + a.imag * b.imag) / denom,
32189 : (a.imag * b.real - a.real * b.imag) / denom);
32190 : }
32191 : }
32192 : #endif
32193 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
32194 : __pyx_t_double_complex z;
32195 : z.real = -a.real;
32196 : z.imag = -a.imag;
32197 : return z;
32198 : }
32199 : static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
32200 : return (a.real == 0) && (a.imag == 0);
32201 : }
32202 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
32203 : __pyx_t_double_complex z;
32204 : z.real = a.real;
32205 : z.imag = -a.imag;
32206 : return z;
32207 : }
32208 : #if 1
32209 : static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
32210 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32211 : return sqrt(z.real*z.real + z.imag*z.imag);
32212 : #else
32213 : return hypot(z.real, z.imag);
32214 : #endif
32215 : }
32216 : static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
32217 : __pyx_t_double_complex z;
32218 : double r, lnr, theta, z_r, z_theta;
32219 : if (b.imag == 0 && b.real == (int)b.real) {
32220 : if (b.real < 0) {
32221 : double denom = a.real * a.real + a.imag * a.imag;
32222 : a.real = a.real / denom;
32223 : a.imag = -a.imag / denom;
32224 : b.real = -b.real;
32225 : }
32226 : switch ((int)b.real) {
32227 : case 0:
32228 : z.real = 1;
32229 : z.imag = 0;
32230 : return z;
32231 : case 1:
32232 : return a;
32233 : case 2:
32234 : return __Pyx_c_prod_double(a, a);
32235 : case 3:
32236 : z = __Pyx_c_prod_double(a, a);
32237 : return __Pyx_c_prod_double(z, a);
32238 : case 4:
32239 : z = __Pyx_c_prod_double(a, a);
32240 : return __Pyx_c_prod_double(z, z);
32241 : }
32242 : }
32243 : if (a.imag == 0) {
32244 : if (a.real == 0) {
32245 : return a;
32246 : } else if ((b.imag == 0) && (a.real >= 0)) {
32247 : z.real = pow(a.real, b.real);
32248 : z.imag = 0;
32249 : return z;
32250 : } else if (a.real > 0) {
32251 : r = a.real;
32252 : theta = 0;
32253 : } else {
32254 : r = -a.real;
32255 : theta = atan2(0.0, -1.0);
32256 : }
32257 : } else {
32258 : r = __Pyx_c_abs_double(a);
32259 : theta = atan2(a.imag, a.real);
32260 : }
32261 : lnr = log(r);
32262 : z_r = exp(lnr * b.real - theta * b.imag);
32263 : z_theta = theta * b.real + lnr * b.imag;
32264 : z.real = z_r * cos(z_theta);
32265 : z.imag = z_r * sin(z_theta);
32266 : return z;
32267 : }
32268 : #endif
32269 : #endif
32270 :
32271 : /* Declarations */
32272 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32273 : #ifdef __cplusplus
32274 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
32275 : return ::std::complex< long double >(x, y);
32276 : }
32277 : #else
32278 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
32279 : return x + y*(__pyx_t_long_double_complex)_Complex_I;
32280 : }
32281 : #endif
32282 : #else
32283 : static CYTHON_INLINE __pyx_t_long_double_complex __pyx_t_long_double_complex_from_parts(long double x, long double y) {
32284 : __pyx_t_long_double_complex z;
32285 : z.real = x;
32286 : z.imag = y;
32287 : return z;
32288 : }
32289 : #endif
32290 :
32291 : /* Arithmetic */
32292 : #if CYTHON_CCOMPLEX && (1) && (!0 || __cplusplus)
32293 : #else
32294 : static CYTHON_INLINE int __Pyx_c_eq_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32295 : return (a.real == b.real) && (a.imag == b.imag);
32296 : }
32297 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_sum_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32298 : __pyx_t_long_double_complex z;
32299 : z.real = a.real + b.real;
32300 : z.imag = a.imag + b.imag;
32301 : return z;
32302 : }
32303 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_diff_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32304 : __pyx_t_long_double_complex z;
32305 : z.real = a.real - b.real;
32306 : z.imag = a.imag - b.imag;
32307 : return z;
32308 : }
32309 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_prod_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32310 : __pyx_t_long_double_complex z;
32311 : z.real = a.real * b.real - a.imag * b.imag;
32312 : z.imag = a.real * b.imag + a.imag * b.real;
32313 : return z;
32314 : }
32315 : #if 1
32316 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32317 : if (b.imag == 0) {
32318 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32319 : } else if (fabsl(b.real) >= fabsl(b.imag)) {
32320 : if (b.real == 0 && b.imag == 0) {
32321 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
32322 : } else {
32323 : long double r = b.imag / b.real;
32324 : long double s = (long double)(1.0) / (b.real + b.imag * r);
32325 : return __pyx_t_long_double_complex_from_parts(
32326 : (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
32327 : }
32328 : } else {
32329 : long double r = b.real / b.imag;
32330 : long double s = (long double)(1.0) / (b.imag + b.real * r);
32331 : return __pyx_t_long_double_complex_from_parts(
32332 : (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
32333 : }
32334 : }
32335 : #else
32336 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_quot_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32337 : if (b.imag == 0) {
32338 : return __pyx_t_long_double_complex_from_parts(a.real / b.real, a.imag / b.real);
32339 : } else {
32340 : long double denom = b.real * b.real + b.imag * b.imag;
32341 : return __pyx_t_long_double_complex_from_parts(
32342 : (a.real * b.real + a.imag * b.imag) / denom,
32343 : (a.imag * b.real - a.real * b.imag) / denom);
32344 : }
32345 : }
32346 : #endif
32347 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_neg_long__double(__pyx_t_long_double_complex a) {
32348 : __pyx_t_long_double_complex z;
32349 : z.real = -a.real;
32350 : z.imag = -a.imag;
32351 : return z;
32352 : }
32353 : static CYTHON_INLINE int __Pyx_c_is_zero_long__double(__pyx_t_long_double_complex a) {
32354 : return (a.real == 0) && (a.imag == 0);
32355 : }
32356 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_conj_long__double(__pyx_t_long_double_complex a) {
32357 : __pyx_t_long_double_complex z;
32358 : z.real = a.real;
32359 : z.imag = -a.imag;
32360 : return z;
32361 : }
32362 : #if 1
32363 : static CYTHON_INLINE long double __Pyx_c_abs_long__double(__pyx_t_long_double_complex z) {
32364 : #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
32365 : return sqrtl(z.real*z.real + z.imag*z.imag);
32366 : #else
32367 : return hypotl(z.real, z.imag);
32368 : #endif
32369 : }
32370 : static CYTHON_INLINE __pyx_t_long_double_complex __Pyx_c_pow_long__double(__pyx_t_long_double_complex a, __pyx_t_long_double_complex b) {
32371 : __pyx_t_long_double_complex z;
32372 : long double r, lnr, theta, z_r, z_theta;
32373 : if (b.imag == 0 && b.real == (int)b.real) {
32374 : if (b.real < 0) {
32375 : long double denom = a.real * a.real + a.imag * a.imag;
32376 : a.real = a.real / denom;
32377 : a.imag = -a.imag / denom;
32378 : b.real = -b.real;
32379 : }
32380 : switch ((int)b.real) {
32381 : case 0:
32382 : z.real = 1;
32383 : z.imag = 0;
32384 : return z;
32385 : case 1:
32386 : return a;
32387 : case 2:
32388 : return __Pyx_c_prod_long__double(a, a);
32389 : case 3:
32390 : z = __Pyx_c_prod_long__double(a, a);
32391 : return __Pyx_c_prod_long__double(z, a);
32392 : case 4:
32393 : z = __Pyx_c_prod_long__double(a, a);
32394 : return __Pyx_c_prod_long__double(z, z);
32395 : }
32396 : }
32397 : if (a.imag == 0) {
32398 : if (a.real == 0) {
32399 : return a;
32400 : } else if ((b.imag == 0) && (a.real >= 0)) {
32401 : z.real = powl(a.real, b.real);
32402 : z.imag = 0;
32403 : return z;
32404 : } else if (a.real > 0) {
32405 : r = a.real;
32406 : theta = 0;
32407 : } else {
32408 : r = -a.real;
32409 : theta = atan2l(0.0, -1.0);
32410 : }
32411 : } else {
32412 : r = __Pyx_c_abs_long__double(a);
32413 : theta = atan2l(a.imag, a.real);
32414 : }
32415 : lnr = logl(r);
32416 : z_r = expl(lnr * b.real - theta * b.imag);
32417 : z_theta = theta * b.real + lnr * b.imag;
32418 : z.real = z_r * cosl(z_theta);
32419 : z.imag = z_r * sinl(z_theta);
32420 : return z;
32421 : }
32422 : #endif
32423 : #endif
32424 :
32425 : /* MemviewSliceCopyTemplate */
32426 : static __Pyx_memviewslice
32427 0 : __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
32428 : const char *mode, int ndim,
32429 : size_t sizeof_dtype, int contig_flag,
32430 : int dtype_is_object)
32431 : {
32432 : __Pyx_RefNannyDeclarations
32433 0 : int i;
32434 0 : __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
32435 0 : struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
32436 0 : Py_buffer *buf = &from_memview->view;
32437 0 : PyObject *shape_tuple = NULL;
32438 0 : PyObject *temp_int = NULL;
32439 0 : struct __pyx_array_obj *array_obj = NULL;
32440 0 : struct __pyx_memoryview_obj *memview_obj = NULL;
32441 0 : __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
32442 0 : for (i = 0; i < ndim; i++) {
32443 0 : if (unlikely(from_mvs->suboffsets[i] >= 0)) {
32444 0 : PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
32445 : "indirect dimensions (axis %d)", i);
32446 0 : goto fail;
32447 : }
32448 : }
32449 0 : shape_tuple = PyTuple_New(ndim);
32450 0 : if (unlikely(!shape_tuple)) {
32451 0 : goto fail;
32452 : }
32453 : __Pyx_GOTREF(shape_tuple);
32454 0 : for(i = 0; i < ndim; i++) {
32455 0 : temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
32456 0 : if(unlikely(!temp_int)) {
32457 0 : goto fail;
32458 : } else {
32459 0 : PyTuple_SET_ITEM(shape_tuple, i, temp_int);
32460 0 : temp_int = NULL;
32461 : }
32462 : }
32463 0 : array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
32464 0 : if (unlikely(!array_obj)) {
32465 0 : goto fail;
32466 : }
32467 0 : __Pyx_GOTREF(array_obj);
32468 0 : memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
32469 : (PyObject *) array_obj, contig_flag,
32470 : dtype_is_object,
32471 0 : from_mvs->memview->typeinfo);
32472 0 : if (unlikely(!memview_obj))
32473 0 : goto fail;
32474 0 : if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
32475 0 : goto fail;
32476 0 : if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
32477 : dtype_is_object) < 0))
32478 0 : goto fail;
32479 0 : goto no_fail;
32480 0 : fail:
32481 0 : __Pyx_XDECREF(new_mvs.memview);
32482 0 : new_mvs.memview = NULL;
32483 0 : new_mvs.data = NULL;
32484 0 : no_fail:
32485 0 : __Pyx_XDECREF(shape_tuple);
32486 0 : __Pyx_XDECREF(temp_int);
32487 0 : __Pyx_XDECREF(array_obj);
32488 0 : __Pyx_RefNannyFinishContext();
32489 0 : return new_mvs;
32490 : }
32491 :
32492 : /* MemviewSliceInit */
32493 : static int
32494 633 : __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
32495 : int ndim,
32496 : __Pyx_memviewslice *memviewslice,
32497 : int memview_is_new_reference)
32498 : {
32499 : __Pyx_RefNannyDeclarations
32500 633 : int i, retval=-1;
32501 633 : Py_buffer *buf = &memview->view;
32502 633 : __Pyx_RefNannySetupContext("init_memviewslice", 0);
32503 633 : if (unlikely(memviewslice->memview || memviewslice->data)) {
32504 0 : PyErr_SetString(PyExc_ValueError,
32505 : "memviewslice is already initialized!");
32506 0 : goto fail;
32507 : }
32508 633 : if (buf->strides) {
32509 1266 : for (i = 0; i < ndim; i++) {
32510 633 : memviewslice->strides[i] = buf->strides[i];
32511 : }
32512 : } else {
32513 0 : Py_ssize_t stride = buf->itemsize;
32514 0 : for (i = ndim - 1; i >= 0; i--) {
32515 0 : memviewslice->strides[i] = stride;
32516 0 : stride *= buf->shape[i];
32517 : }
32518 : }
32519 1266 : for (i = 0; i < ndim; i++) {
32520 633 : memviewslice->shape[i] = buf->shape[i];
32521 633 : if (buf->suboffsets) {
32522 0 : memviewslice->suboffsets[i] = buf->suboffsets[i];
32523 : } else {
32524 633 : memviewslice->suboffsets[i] = -1;
32525 : }
32526 : }
32527 633 : memviewslice->memview = memview;
32528 633 : memviewslice->data = (char *)buf->buf;
32529 633 : if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
32530 0 : Py_INCREF(memview);
32531 : }
32532 633 : retval = 0;
32533 633 : goto no_fail;
32534 0 : fail:
32535 0 : memviewslice->memview = 0;
32536 0 : memviewslice->data = 0;
32537 0 : retval = -1;
32538 633 : no_fail:
32539 633 : __Pyx_RefNannyFinishContext();
32540 633 : return retval;
32541 : }
32542 : #ifndef Py_NO_RETURN
32543 : #define Py_NO_RETURN
32544 : #endif
32545 0 : static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
32546 0 : va_list vargs;
32547 0 : char msg[200];
32548 : #if PY_VERSION_HEX >= 0x030A0000 || defined(HAVE_STDARG_PROTOTYPES)
32549 0 : va_start(vargs, fmt);
32550 : #else
32551 : va_start(vargs);
32552 : #endif
32553 0 : vsnprintf(msg, 200, fmt, vargs);
32554 0 : va_end(vargs);
32555 0 : Py_FatalError(msg);
32556 : }
32557 : static CYTHON_INLINE int
32558 : __pyx_add_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
32559 : PyThread_type_lock lock)
32560 : {
32561 : int result;
32562 : PyThread_acquire_lock(lock, 1);
32563 : result = (*acquisition_count)++;
32564 : PyThread_release_lock(lock);
32565 : return result;
32566 : }
32567 : static CYTHON_INLINE int
32568 : __pyx_sub_acquisition_count_locked(__pyx_atomic_int_type *acquisition_count,
32569 : PyThread_type_lock lock)
32570 : {
32571 : int result;
32572 : PyThread_acquire_lock(lock, 1);
32573 : result = (*acquisition_count)--;
32574 : PyThread_release_lock(lock);
32575 : return result;
32576 : }
32577 : static CYTHON_INLINE void
32578 430 : __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
32579 : {
32580 430 : __pyx_nonatomic_int_type old_acquisition_count;
32581 430 : struct __pyx_memoryview_obj *memview = memslice->memview;
32582 430 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
32583 : return;
32584 : }
32585 430 : old_acquisition_count = __pyx_add_acquisition_count(memview);
32586 430 : if (unlikely(old_acquisition_count <= 0)) {
32587 0 : if (likely(old_acquisition_count == 0)) {
32588 0 : if (have_gil) {
32589 0 : Py_INCREF((PyObject *) memview);
32590 : } else {
32591 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
32592 0 : Py_INCREF((PyObject *) memview);
32593 0 : PyGILState_Release(_gilstate);
32594 : }
32595 : } else {
32596 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
32597 : old_acquisition_count+1, lineno);
32598 : }
32599 : }
32600 : }
32601 1112 : static CYTHON_INLINE void __Pyx_XCLEAR_MEMVIEW(__Pyx_memviewslice *memslice,
32602 : int have_gil, int lineno) {
32603 1112 : __pyx_nonatomic_int_type old_acquisition_count;
32604 1112 : struct __pyx_memoryview_obj *memview = memslice->memview;
32605 1112 : if (unlikely(!memview || (PyObject *) memview == Py_None)) {
32606 49 : memslice->memview = NULL;
32607 49 : return;
32608 : }
32609 1063 : old_acquisition_count = __pyx_sub_acquisition_count(memview);
32610 1063 : memslice->data = NULL;
32611 1063 : if (likely(old_acquisition_count > 1)) {
32612 430 : memslice->memview = NULL;
32613 633 : } else if (likely(old_acquisition_count == 1)) {
32614 633 : if (have_gil) {
32615 633 : Py_CLEAR(memslice->memview);
32616 : } else {
32617 0 : PyGILState_STATE _gilstate = PyGILState_Ensure();
32618 0 : Py_CLEAR(memslice->memview);
32619 0 : PyGILState_Release(_gilstate);
32620 : }
32621 : } else {
32622 0 : __pyx_fatalerror("Acquisition count is %d (line %d)",
32623 : old_acquisition_count-1, lineno);
32624 : }
32625 : }
32626 :
32627 : /* CIntFromPy */
32628 56 : static CYTHON_INLINE npy_intp __Pyx_PyInt_As_npy_intp(PyObject *x) {
32629 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32630 : #pragma GCC diagnostic push
32631 : #pragma GCC diagnostic ignored "-Wconversion"
32632 : #endif
32633 56 : const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
32634 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32635 : #pragma GCC diagnostic pop
32636 : #endif
32637 56 : const int is_unsigned = neg_one > const_zero;
32638 : #if PY_MAJOR_VERSION < 3
32639 : if (likely(PyInt_Check(x))) {
32640 : if ((sizeof(npy_intp) < sizeof(long))) {
32641 : __PYX_VERIFY_RETURN_INT(npy_intp, long, PyInt_AS_LONG(x))
32642 : } else {
32643 : long val = PyInt_AS_LONG(x);
32644 : if (is_unsigned && unlikely(val < 0)) {
32645 : goto raise_neg_overflow;
32646 : }
32647 : return (npy_intp) val;
32648 : }
32649 : }
32650 : #endif
32651 56 : if (unlikely(!PyLong_Check(x))) {
32652 9 : npy_intp val;
32653 9 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
32654 9 : if (!tmp) return (npy_intp) -1;
32655 9 : val = __Pyx_PyInt_As_npy_intp(tmp);
32656 9 : Py_DECREF(tmp);
32657 9 : return val;
32658 : }
32659 47 : if (is_unsigned) {
32660 : #if CYTHON_USE_PYLONG_INTERNALS
32661 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
32662 : goto raise_neg_overflow;
32663 : } else if (__Pyx_PyLong_IsCompact(x)) {
32664 : __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
32665 : } else {
32666 : const digit* digits = __Pyx_PyLong_Digits(x);
32667 : assert(__Pyx_PyLong_DigitCount(x) > 1);
32668 : switch (__Pyx_PyLong_DigitCount(x)) {
32669 : case 2:
32670 : if ((8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
32671 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
32672 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32673 : } else if ((8 * sizeof(npy_intp) >= 2 * PyLong_SHIFT)) {
32674 : return (npy_intp) (((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
32675 : }
32676 : }
32677 : break;
32678 : case 3:
32679 : if ((8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
32680 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
32681 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32682 : } else if ((8 * sizeof(npy_intp) >= 3 * PyLong_SHIFT)) {
32683 : return (npy_intp) (((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
32684 : }
32685 : }
32686 : break;
32687 : case 4:
32688 : if ((8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
32689 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
32690 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32691 : } else if ((8 * sizeof(npy_intp) >= 4 * PyLong_SHIFT)) {
32692 : return (npy_intp) (((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0]));
32693 : }
32694 : }
32695 : break;
32696 : }
32697 : }
32698 : #endif
32699 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
32700 : if (unlikely(Py_SIZE(x) < 0)) {
32701 : goto raise_neg_overflow;
32702 : }
32703 : #else
32704 : {
32705 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
32706 : if (unlikely(result < 0))
32707 : return (npy_intp) -1;
32708 : if (unlikely(result == 1))
32709 : goto raise_neg_overflow;
32710 : }
32711 : #endif
32712 : if ((sizeof(npy_intp) <= sizeof(unsigned long))) {
32713 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned long, PyLong_AsUnsignedLong(x))
32714 : #ifdef HAVE_LONG_LONG
32715 : } else if ((sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG))) {
32716 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
32717 : #endif
32718 : }
32719 : } else {
32720 : #if CYTHON_USE_PYLONG_INTERNALS
32721 47 : if (__Pyx_PyLong_IsCompact(x)) {
32722 47 : __PYX_VERIFY_RETURN_INT(npy_intp, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
32723 : } else {
32724 0 : const digit* digits = __Pyx_PyLong_Digits(x);
32725 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
32726 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
32727 : case -2:
32728 0 : if ((8 * sizeof(npy_intp) - 1 > 1 * PyLong_SHIFT)) {
32729 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
32730 0 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32731 : } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
32732 : return (npy_intp) (((npy_intp)-1)*(((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
32733 : }
32734 : }
32735 : break;
32736 : case 2:
32737 0 : if ((8 * sizeof(npy_intp) > 1 * PyLong_SHIFT)) {
32738 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
32739 0 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32740 : } else if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
32741 : return (npy_intp) ((((((npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
32742 : }
32743 : }
32744 : break;
32745 : case -3:
32746 : if ((8 * sizeof(npy_intp) - 1 > 2 * PyLong_SHIFT)) {
32747 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
32748 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32749 : } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
32750 : return (npy_intp) (((npy_intp)-1)*(((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
32751 : }
32752 : }
32753 : break;
32754 : case 3:
32755 : if ((8 * sizeof(npy_intp) > 2 * PyLong_SHIFT)) {
32756 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
32757 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32758 : } else if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
32759 : return (npy_intp) ((((((((npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
32760 : }
32761 : }
32762 : break;
32763 : case -4:
32764 : if ((8 * sizeof(npy_intp) - 1 > 3 * PyLong_SHIFT)) {
32765 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
32766 : __PYX_VERIFY_RETURN_INT(npy_intp, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32767 : } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
32768 : return (npy_intp) (((npy_intp)-1)*(((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
32769 : }
32770 : }
32771 : break;
32772 : case 4:
32773 : if ((8 * sizeof(npy_intp) > 3 * PyLong_SHIFT)) {
32774 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
32775 : __PYX_VERIFY_RETURN_INT(npy_intp, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
32776 : } else if ((8 * sizeof(npy_intp) - 1 > 4 * PyLong_SHIFT)) {
32777 : return (npy_intp) ((((((((((npy_intp)digits[3]) << PyLong_SHIFT) | (npy_intp)digits[2]) << PyLong_SHIFT) | (npy_intp)digits[1]) << PyLong_SHIFT) | (npy_intp)digits[0])));
32778 : }
32779 : }
32780 : break;
32781 : }
32782 : }
32783 : #endif
32784 0 : if ((sizeof(npy_intp) <= sizeof(long))) {
32785 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, long, PyLong_AsLong(x))
32786 : #ifdef HAVE_LONG_LONG
32787 : } else if ((sizeof(npy_intp) <= sizeof(PY_LONG_LONG))) {
32788 : __PYX_VERIFY_RETURN_INT_EXC(npy_intp, PY_LONG_LONG, PyLong_AsLongLong(x))
32789 : #endif
32790 : }
32791 : }
32792 : {
32793 : npy_intp val;
32794 : int ret = -1;
32795 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
32796 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
32797 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
32798 : if (unlikely(bytes_copied == -1)) {
32799 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
32800 : goto raise_overflow;
32801 : } else {
32802 : ret = 0;
32803 : }
32804 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
32805 : int one = 1; int is_little = (int)*(unsigned char *)&one;
32806 : unsigned char *bytes = (unsigned char *)&val;
32807 : ret = _PyLong_AsByteArray((PyLongObject *)x,
32808 : bytes, sizeof(val),
32809 : is_little, !is_unsigned);
32810 : #else
32811 : PyObject *v;
32812 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
32813 : int bits, remaining_bits, is_negative = 0;
32814 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
32815 : if (likely(PyLong_CheckExact(x))) {
32816 : v = __Pyx_NewRef(x);
32817 : } else {
32818 : v = PyNumber_Long(x);
32819 : if (unlikely(!v)) return (npy_intp) -1;
32820 : assert(PyLong_CheckExact(v));
32821 : }
32822 : {
32823 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
32824 : if (unlikely(result < 0)) {
32825 : Py_DECREF(v);
32826 : return (npy_intp) -1;
32827 : }
32828 : is_negative = result == 1;
32829 : }
32830 : if (is_unsigned && unlikely(is_negative)) {
32831 : Py_DECREF(v);
32832 : goto raise_neg_overflow;
32833 : } else if (is_negative) {
32834 : stepval = PyNumber_Invert(v);
32835 : Py_DECREF(v);
32836 : if (unlikely(!stepval))
32837 : return (npy_intp) -1;
32838 : } else {
32839 : stepval = v;
32840 : }
32841 : v = NULL;
32842 : val = (npy_intp) 0;
32843 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
32844 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
32845 : for (bits = 0; bits < (int) sizeof(npy_intp) * 8 - chunk_size; bits += chunk_size) {
32846 : PyObject *tmp, *digit;
32847 : long idigit;
32848 : digit = PyNumber_And(stepval, mask);
32849 : if (unlikely(!digit)) goto done;
32850 : idigit = PyLong_AsLong(digit);
32851 : Py_DECREF(digit);
32852 : if (unlikely(idigit < 0)) goto done;
32853 : val |= ((npy_intp) idigit) << bits;
32854 : tmp = PyNumber_Rshift(stepval, shift);
32855 : if (unlikely(!tmp)) goto done;
32856 : Py_DECREF(stepval); stepval = tmp;
32857 : }
32858 : Py_DECREF(shift); shift = NULL;
32859 : Py_DECREF(mask); mask = NULL;
32860 : {
32861 : long idigit = PyLong_AsLong(stepval);
32862 : if (unlikely(idigit < 0)) goto done;
32863 : remaining_bits = ((int) sizeof(npy_intp) * 8) - bits - (is_unsigned ? 0 : 1);
32864 : if (unlikely(idigit >= (1L << remaining_bits)))
32865 : goto raise_overflow;
32866 : val |= ((npy_intp) idigit) << bits;
32867 : }
32868 : if (!is_unsigned) {
32869 : if (unlikely(val & (((npy_intp) 1) << (sizeof(npy_intp) * 8 - 1))))
32870 : goto raise_overflow;
32871 : if (is_negative)
32872 : val = ~val;
32873 : }
32874 : ret = 0;
32875 : done:
32876 : Py_XDECREF(shift);
32877 : Py_XDECREF(mask);
32878 : Py_XDECREF(stepval);
32879 : #endif
32880 : if (unlikely(ret))
32881 : return (npy_intp) -1;
32882 : return val;
32883 : }
32884 : raise_overflow:
32885 : PyErr_SetString(PyExc_OverflowError,
32886 : "value too large to convert to npy_intp");
32887 : return (npy_intp) -1;
32888 : raise_neg_overflow:
32889 : PyErr_SetString(PyExc_OverflowError,
32890 : "can't convert negative value to npy_intp");
32891 : return (npy_intp) -1;
32892 : }
32893 :
32894 : /* CIntToPy */
32895 125 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_intp(npy_intp value) {
32896 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32897 : #pragma GCC diagnostic push
32898 : #pragma GCC diagnostic ignored "-Wconversion"
32899 : #endif
32900 125 : const npy_intp neg_one = (npy_intp) -1, const_zero = (npy_intp) 0;
32901 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32902 : #pragma GCC diagnostic pop
32903 : #endif
32904 125 : const int is_unsigned = neg_one > const_zero;
32905 125 : if (is_unsigned) {
32906 : if (sizeof(npy_intp) < sizeof(long)) {
32907 : return PyInt_FromLong((long) value);
32908 : } else if (sizeof(npy_intp) <= sizeof(unsigned long)) {
32909 : return PyLong_FromUnsignedLong((unsigned long) value);
32910 : #ifdef HAVE_LONG_LONG
32911 : } else if (sizeof(npy_intp) <= sizeof(unsigned PY_LONG_LONG)) {
32912 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
32913 : #endif
32914 : }
32915 : } else {
32916 125 : if (sizeof(npy_intp) <= sizeof(long)) {
32917 125 : return PyInt_FromLong((long) value);
32918 : #ifdef HAVE_LONG_LONG
32919 : } else if (sizeof(npy_intp) <= sizeof(PY_LONG_LONG)) {
32920 : return PyLong_FromLongLong((PY_LONG_LONG) value);
32921 : #endif
32922 : }
32923 : }
32924 : {
32925 : unsigned char *bytes = (unsigned char *)&value;
32926 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
32927 : if (is_unsigned) {
32928 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
32929 : } else {
32930 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
32931 : }
32932 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
32933 : int one = 1; int little = (int)*(unsigned char *)&one;
32934 : return _PyLong_FromByteArray(bytes, sizeof(npy_intp),
32935 : little, !is_unsigned);
32936 : #else
32937 : int one = 1; int little = (int)*(unsigned char *)&one;
32938 : PyObject *from_bytes, *result = NULL;
32939 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
32940 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
32941 : if (!from_bytes) return NULL;
32942 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_intp));
32943 : if (!py_bytes) goto limited_bad;
32944 : order_str = PyUnicode_FromString(little ? "little" : "big");
32945 : if (!order_str) goto limited_bad;
32946 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
32947 : if (!arg_tuple) goto limited_bad;
32948 : if (!is_unsigned) {
32949 : kwds = PyDict_New();
32950 : if (!kwds) goto limited_bad;
32951 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
32952 : }
32953 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
32954 : limited_bad:
32955 : Py_XDECREF(kwds);
32956 : Py_XDECREF(arg_tuple);
32957 : Py_XDECREF(order_str);
32958 : Py_XDECREF(py_bytes);
32959 : Py_XDECREF(from_bytes);
32960 : return result;
32961 : #endif
32962 : }
32963 : }
32964 :
32965 : /* CIntToPy */
32966 0 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint8(npy_uint8 value) {
32967 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32968 : #pragma GCC diagnostic push
32969 : #pragma GCC diagnostic ignored "-Wconversion"
32970 : #endif
32971 0 : const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0;
32972 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32973 : #pragma GCC diagnostic pop
32974 : #endif
32975 0 : const int is_unsigned = neg_one > const_zero;
32976 0 : if (is_unsigned) {
32977 0 : if (sizeof(npy_uint8) < sizeof(long)) {
32978 0 : return PyInt_FromLong((long) value);
32979 : } else if (sizeof(npy_uint8) <= sizeof(unsigned long)) {
32980 : return PyLong_FromUnsignedLong((unsigned long) value);
32981 : #ifdef HAVE_LONG_LONG
32982 : } else if (sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG)) {
32983 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
32984 : #endif
32985 : }
32986 : } else {
32987 : if (sizeof(npy_uint8) <= sizeof(long)) {
32988 : return PyInt_FromLong((long) value);
32989 : #ifdef HAVE_LONG_LONG
32990 : } else if (sizeof(npy_uint8) <= sizeof(PY_LONG_LONG)) {
32991 : return PyLong_FromLongLong((PY_LONG_LONG) value);
32992 : #endif
32993 : }
32994 : }
32995 : {
32996 : unsigned char *bytes = (unsigned char *)&value;
32997 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
32998 : if (is_unsigned) {
32999 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
33000 : } else {
33001 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
33002 : }
33003 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
33004 : int one = 1; int little = (int)*(unsigned char *)&one;
33005 : return _PyLong_FromByteArray(bytes, sizeof(npy_uint8),
33006 : little, !is_unsigned);
33007 : #else
33008 : int one = 1; int little = (int)*(unsigned char *)&one;
33009 : PyObject *from_bytes, *result = NULL;
33010 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
33011 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
33012 : if (!from_bytes) return NULL;
33013 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(npy_uint8));
33014 : if (!py_bytes) goto limited_bad;
33015 : order_str = PyUnicode_FromString(little ? "little" : "big");
33016 : if (!order_str) goto limited_bad;
33017 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
33018 : if (!arg_tuple) goto limited_bad;
33019 : if (!is_unsigned) {
33020 : kwds = PyDict_New();
33021 : if (!kwds) goto limited_bad;
33022 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
33023 : }
33024 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
33025 : limited_bad:
33026 : Py_XDECREF(kwds);
33027 : Py_XDECREF(arg_tuple);
33028 : Py_XDECREF(order_str);
33029 : Py_XDECREF(py_bytes);
33030 : Py_XDECREF(from_bytes);
33031 : return result;
33032 : #endif
33033 : }
33034 : }
33035 :
33036 : /* CIntFromPy */
33037 0 : static CYTHON_INLINE npy_uint8 __Pyx_PyInt_As_npy_uint8(PyObject *x) {
33038 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33039 : #pragma GCC diagnostic push
33040 : #pragma GCC diagnostic ignored "-Wconversion"
33041 : #endif
33042 0 : const npy_uint8 neg_one = (npy_uint8) -1, const_zero = (npy_uint8) 0;
33043 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33044 : #pragma GCC diagnostic pop
33045 : #endif
33046 0 : const int is_unsigned = neg_one > const_zero;
33047 : #if PY_MAJOR_VERSION < 3
33048 : if (likely(PyInt_Check(x))) {
33049 : if ((sizeof(npy_uint8) < sizeof(long))) {
33050 : __PYX_VERIFY_RETURN_INT(npy_uint8, long, PyInt_AS_LONG(x))
33051 : } else {
33052 : long val = PyInt_AS_LONG(x);
33053 : if (is_unsigned && unlikely(val < 0)) {
33054 : goto raise_neg_overflow;
33055 : }
33056 : return (npy_uint8) val;
33057 : }
33058 : }
33059 : #endif
33060 0 : if (unlikely(!PyLong_Check(x))) {
33061 0 : npy_uint8 val;
33062 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33063 0 : if (!tmp) return (npy_uint8) -1;
33064 0 : val = __Pyx_PyInt_As_npy_uint8(tmp);
33065 0 : Py_DECREF(tmp);
33066 0 : return val;
33067 : }
33068 0 : if (is_unsigned) {
33069 : #if CYTHON_USE_PYLONG_INTERNALS
33070 0 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
33071 0 : goto raise_neg_overflow;
33072 0 : } else if (__Pyx_PyLong_IsCompact(x)) {
33073 0 : __PYX_VERIFY_RETURN_INT(npy_uint8, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
33074 : } else {
33075 0 : const digit* digits = __Pyx_PyLong_Digits(x);
33076 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
33077 0 : switch (__Pyx_PyLong_DigitCount(x)) {
33078 : case 2:
33079 : if ((8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT)) {
33080 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33081 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33082 : } else if ((8 * sizeof(npy_uint8) >= 2 * PyLong_SHIFT)) {
33083 : return (npy_uint8) (((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
33084 : }
33085 : }
33086 : break;
33087 : case 3:
33088 : if ((8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT)) {
33089 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33090 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33091 : } else if ((8 * sizeof(npy_uint8) >= 3 * PyLong_SHIFT)) {
33092 : return (npy_uint8) (((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
33093 : }
33094 : }
33095 : break;
33096 : case 4:
33097 0 : if ((8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT)) {
33098 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33099 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33100 : } else if ((8 * sizeof(npy_uint8) >= 4 * PyLong_SHIFT)) {
33101 : return (npy_uint8) (((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0]));
33102 : }
33103 : }
33104 0 : break;
33105 : }
33106 : }
33107 : #endif
33108 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33109 : if (unlikely(Py_SIZE(x) < 0)) {
33110 : goto raise_neg_overflow;
33111 : }
33112 : #else
33113 : {
33114 0 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33115 0 : if (unlikely(result < 0))
33116 : return (npy_uint8) -1;
33117 0 : if (unlikely(result == 1))
33118 0 : goto raise_neg_overflow;
33119 : }
33120 : #endif
33121 0 : if ((sizeof(npy_uint8) <= sizeof(unsigned long))) {
33122 0 : __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned long, PyLong_AsUnsignedLong(x))
33123 : #ifdef HAVE_LONG_LONG
33124 : } else if ((sizeof(npy_uint8) <= sizeof(unsigned PY_LONG_LONG))) {
33125 : __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33126 : #endif
33127 : }
33128 : } else {
33129 : #if CYTHON_USE_PYLONG_INTERNALS
33130 : if (__Pyx_PyLong_IsCompact(x)) {
33131 : __PYX_VERIFY_RETURN_INT(npy_uint8, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
33132 : } else {
33133 : const digit* digits = __Pyx_PyLong_Digits(x);
33134 : assert(__Pyx_PyLong_DigitCount(x) > 1);
33135 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
33136 : case -2:
33137 : if ((8 * sizeof(npy_uint8) - 1 > 1 * PyLong_SHIFT)) {
33138 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33139 : __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33140 : } else if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
33141 : return (npy_uint8) (((npy_uint8)-1)*(((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
33142 : }
33143 : }
33144 : break;
33145 : case 2:
33146 : if ((8 * sizeof(npy_uint8) > 1 * PyLong_SHIFT)) {
33147 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33148 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33149 : } else if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
33150 : return (npy_uint8) ((((((npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
33151 : }
33152 : }
33153 : break;
33154 : case -3:
33155 : if ((8 * sizeof(npy_uint8) - 1 > 2 * PyLong_SHIFT)) {
33156 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33157 : __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33158 : } else if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
33159 : return (npy_uint8) (((npy_uint8)-1)*(((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
33160 : }
33161 : }
33162 : break;
33163 : case 3:
33164 : if ((8 * sizeof(npy_uint8) > 2 * PyLong_SHIFT)) {
33165 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33166 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33167 : } else if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
33168 : return (npy_uint8) ((((((((npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
33169 : }
33170 : }
33171 : break;
33172 : case -4:
33173 : if ((8 * sizeof(npy_uint8) - 1 > 3 * PyLong_SHIFT)) {
33174 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33175 : __PYX_VERIFY_RETURN_INT(npy_uint8, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33176 : } else if ((8 * sizeof(npy_uint8) - 1 > 4 * PyLong_SHIFT)) {
33177 : return (npy_uint8) (((npy_uint8)-1)*(((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
33178 : }
33179 : }
33180 : break;
33181 : case 4:
33182 : if ((8 * sizeof(npy_uint8) > 3 * PyLong_SHIFT)) {
33183 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33184 : __PYX_VERIFY_RETURN_INT(npy_uint8, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33185 : } else if ((8 * sizeof(npy_uint8) - 1 > 4 * PyLong_SHIFT)) {
33186 : return (npy_uint8) ((((((((((npy_uint8)digits[3]) << PyLong_SHIFT) | (npy_uint8)digits[2]) << PyLong_SHIFT) | (npy_uint8)digits[1]) << PyLong_SHIFT) | (npy_uint8)digits[0])));
33187 : }
33188 : }
33189 : break;
33190 : }
33191 : }
33192 : #endif
33193 : if ((sizeof(npy_uint8) <= sizeof(long))) {
33194 : __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, long, PyLong_AsLong(x))
33195 : #ifdef HAVE_LONG_LONG
33196 : } else if ((sizeof(npy_uint8) <= sizeof(PY_LONG_LONG))) {
33197 : __PYX_VERIFY_RETURN_INT_EXC(npy_uint8, PY_LONG_LONG, PyLong_AsLongLong(x))
33198 : #endif
33199 : }
33200 : }
33201 : {
33202 : npy_uint8 val;
33203 : int ret = -1;
33204 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
33205 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
33206 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
33207 : if (unlikely(bytes_copied == -1)) {
33208 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
33209 : goto raise_overflow;
33210 : } else {
33211 : ret = 0;
33212 : }
33213 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
33214 : int one = 1; int is_little = (int)*(unsigned char *)&one;
33215 : unsigned char *bytes = (unsigned char *)&val;
33216 : ret = _PyLong_AsByteArray((PyLongObject *)x,
33217 : bytes, sizeof(val),
33218 : is_little, !is_unsigned);
33219 : #else
33220 : PyObject *v;
33221 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
33222 : int bits, remaining_bits, is_negative = 0;
33223 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
33224 : if (likely(PyLong_CheckExact(x))) {
33225 : v = __Pyx_NewRef(x);
33226 : } else {
33227 : v = PyNumber_Long(x);
33228 : if (unlikely(!v)) return (npy_uint8) -1;
33229 : assert(PyLong_CheckExact(v));
33230 : }
33231 : {
33232 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
33233 : if (unlikely(result < 0)) {
33234 : Py_DECREF(v);
33235 : return (npy_uint8) -1;
33236 : }
33237 : is_negative = result == 1;
33238 : }
33239 : if (is_unsigned && unlikely(is_negative)) {
33240 : Py_DECREF(v);
33241 : goto raise_neg_overflow;
33242 : } else if (is_negative) {
33243 : stepval = PyNumber_Invert(v);
33244 : Py_DECREF(v);
33245 : if (unlikely(!stepval))
33246 : return (npy_uint8) -1;
33247 : } else {
33248 : stepval = v;
33249 : }
33250 : v = NULL;
33251 : val = (npy_uint8) 0;
33252 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
33253 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
33254 : for (bits = 0; bits < (int) sizeof(npy_uint8) * 8 - chunk_size; bits += chunk_size) {
33255 : PyObject *tmp, *digit;
33256 : long idigit;
33257 : digit = PyNumber_And(stepval, mask);
33258 : if (unlikely(!digit)) goto done;
33259 : idigit = PyLong_AsLong(digit);
33260 : Py_DECREF(digit);
33261 : if (unlikely(idigit < 0)) goto done;
33262 : val |= ((npy_uint8) idigit) << bits;
33263 : tmp = PyNumber_Rshift(stepval, shift);
33264 : if (unlikely(!tmp)) goto done;
33265 : Py_DECREF(stepval); stepval = tmp;
33266 : }
33267 : Py_DECREF(shift); shift = NULL;
33268 : Py_DECREF(mask); mask = NULL;
33269 : {
33270 : long idigit = PyLong_AsLong(stepval);
33271 : if (unlikely(idigit < 0)) goto done;
33272 : remaining_bits = ((int) sizeof(npy_uint8) * 8) - bits - (is_unsigned ? 0 : 1);
33273 : if (unlikely(idigit >= (1L << remaining_bits)))
33274 : goto raise_overflow;
33275 : val |= ((npy_uint8) idigit) << bits;
33276 : }
33277 : if (!is_unsigned) {
33278 : if (unlikely(val & (((npy_uint8) 1) << (sizeof(npy_uint8) * 8 - 1))))
33279 : goto raise_overflow;
33280 : if (is_negative)
33281 : val = ~val;
33282 : }
33283 : ret = 0;
33284 : done:
33285 : Py_XDECREF(shift);
33286 : Py_XDECREF(mask);
33287 : Py_XDECREF(stepval);
33288 : #endif
33289 : if (unlikely(ret))
33290 : return (npy_uint8) -1;
33291 : return val;
33292 : }
33293 0 : raise_overflow:
33294 0 : PyErr_SetString(PyExc_OverflowError,
33295 : "value too large to convert to npy_uint8");
33296 0 : return (npy_uint8) -1;
33297 0 : raise_neg_overflow:
33298 0 : PyErr_SetString(PyExc_OverflowError,
33299 : "can't convert negative value to npy_uint8");
33300 0 : return (npy_uint8) -1;
33301 : }
33302 :
33303 : /* CIntFromPy */
33304 1066 : static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
33305 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33306 : #pragma GCC diagnostic push
33307 : #pragma GCC diagnostic ignored "-Wconversion"
33308 : #endif
33309 1066 : const int neg_one = (int) -1, const_zero = (int) 0;
33310 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33311 : #pragma GCC diagnostic pop
33312 : #endif
33313 1066 : const int is_unsigned = neg_one > const_zero;
33314 : #if PY_MAJOR_VERSION < 3
33315 : if (likely(PyInt_Check(x))) {
33316 : if ((sizeof(int) < sizeof(long))) {
33317 : __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
33318 : } else {
33319 : long val = PyInt_AS_LONG(x);
33320 : if (is_unsigned && unlikely(val < 0)) {
33321 : goto raise_neg_overflow;
33322 : }
33323 : return (int) val;
33324 : }
33325 : }
33326 : #endif
33327 1066 : if (unlikely(!PyLong_Check(x))) {
33328 0 : int val;
33329 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33330 0 : if (!tmp) return (int) -1;
33331 0 : val = __Pyx_PyInt_As_int(tmp);
33332 0 : Py_DECREF(tmp);
33333 0 : return val;
33334 : }
33335 1066 : if (is_unsigned) {
33336 : #if CYTHON_USE_PYLONG_INTERNALS
33337 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
33338 : goto raise_neg_overflow;
33339 : } else if (__Pyx_PyLong_IsCompact(x)) {
33340 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
33341 : } else {
33342 : const digit* digits = __Pyx_PyLong_Digits(x);
33343 : assert(__Pyx_PyLong_DigitCount(x) > 1);
33344 : switch (__Pyx_PyLong_DigitCount(x)) {
33345 : case 2:
33346 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
33347 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33348 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33349 : } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
33350 : return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33351 : }
33352 : }
33353 : break;
33354 : case 3:
33355 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
33356 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33357 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33358 : } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
33359 : return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33360 : }
33361 : }
33362 : break;
33363 : case 4:
33364 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
33365 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33366 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33367 : } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
33368 : return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
33369 : }
33370 : }
33371 : break;
33372 : }
33373 : }
33374 : #endif
33375 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33376 : if (unlikely(Py_SIZE(x) < 0)) {
33377 : goto raise_neg_overflow;
33378 : }
33379 : #else
33380 : {
33381 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33382 : if (unlikely(result < 0))
33383 : return (int) -1;
33384 : if (unlikely(result == 1))
33385 : goto raise_neg_overflow;
33386 : }
33387 : #endif
33388 : if ((sizeof(int) <= sizeof(unsigned long))) {
33389 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
33390 : #ifdef HAVE_LONG_LONG
33391 : } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
33392 : __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33393 : #endif
33394 : }
33395 : } else {
33396 : #if CYTHON_USE_PYLONG_INTERNALS
33397 1066 : if (__Pyx_PyLong_IsCompact(x)) {
33398 1066 : __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
33399 : } else {
33400 0 : const digit* digits = __Pyx_PyLong_Digits(x);
33401 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
33402 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
33403 : case -2:
33404 0 : if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
33405 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33406 0 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33407 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
33408 : return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33409 : }
33410 : }
33411 : break;
33412 : case 2:
33413 0 : if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
33414 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33415 0 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33416 : } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
33417 : return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33418 : }
33419 : }
33420 : break;
33421 : case -3:
33422 : if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
33423 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33424 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33425 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
33426 : return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33427 : }
33428 : }
33429 : break;
33430 : case 3:
33431 : if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
33432 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33433 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33434 : } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
33435 : return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33436 : }
33437 : }
33438 : break;
33439 : case -4:
33440 : if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
33441 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33442 : __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33443 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
33444 : return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33445 : }
33446 : }
33447 : break;
33448 : case 4:
33449 : if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
33450 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33451 : __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33452 : } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
33453 : return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
33454 : }
33455 : }
33456 : break;
33457 : }
33458 : }
33459 : #endif
33460 0 : if ((sizeof(int) <= sizeof(long))) {
33461 0 : __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
33462 : #ifdef HAVE_LONG_LONG
33463 : } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
33464 : __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
33465 : #endif
33466 : }
33467 : }
33468 : {
33469 : int val;
33470 : int ret = -1;
33471 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
33472 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
33473 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
33474 : if (unlikely(bytes_copied == -1)) {
33475 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
33476 : goto raise_overflow;
33477 : } else {
33478 : ret = 0;
33479 : }
33480 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
33481 : int one = 1; int is_little = (int)*(unsigned char *)&one;
33482 : unsigned char *bytes = (unsigned char *)&val;
33483 : ret = _PyLong_AsByteArray((PyLongObject *)x,
33484 : bytes, sizeof(val),
33485 : is_little, !is_unsigned);
33486 : #else
33487 : PyObject *v;
33488 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
33489 : int bits, remaining_bits, is_negative = 0;
33490 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
33491 : if (likely(PyLong_CheckExact(x))) {
33492 : v = __Pyx_NewRef(x);
33493 : } else {
33494 : v = PyNumber_Long(x);
33495 : if (unlikely(!v)) return (int) -1;
33496 : assert(PyLong_CheckExact(v));
33497 : }
33498 : {
33499 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
33500 : if (unlikely(result < 0)) {
33501 : Py_DECREF(v);
33502 : return (int) -1;
33503 : }
33504 : is_negative = result == 1;
33505 : }
33506 : if (is_unsigned && unlikely(is_negative)) {
33507 : Py_DECREF(v);
33508 : goto raise_neg_overflow;
33509 : } else if (is_negative) {
33510 : stepval = PyNumber_Invert(v);
33511 : Py_DECREF(v);
33512 : if (unlikely(!stepval))
33513 : return (int) -1;
33514 : } else {
33515 : stepval = v;
33516 : }
33517 : v = NULL;
33518 : val = (int) 0;
33519 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
33520 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
33521 : for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
33522 : PyObject *tmp, *digit;
33523 : long idigit;
33524 : digit = PyNumber_And(stepval, mask);
33525 : if (unlikely(!digit)) goto done;
33526 : idigit = PyLong_AsLong(digit);
33527 : Py_DECREF(digit);
33528 : if (unlikely(idigit < 0)) goto done;
33529 : val |= ((int) idigit) << bits;
33530 : tmp = PyNumber_Rshift(stepval, shift);
33531 : if (unlikely(!tmp)) goto done;
33532 : Py_DECREF(stepval); stepval = tmp;
33533 : }
33534 : Py_DECREF(shift); shift = NULL;
33535 : Py_DECREF(mask); mask = NULL;
33536 : {
33537 : long idigit = PyLong_AsLong(stepval);
33538 : if (unlikely(idigit < 0)) goto done;
33539 : remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
33540 : if (unlikely(idigit >= (1L << remaining_bits)))
33541 : goto raise_overflow;
33542 : val |= ((int) idigit) << bits;
33543 : }
33544 : if (!is_unsigned) {
33545 : if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
33546 : goto raise_overflow;
33547 : if (is_negative)
33548 : val = ~val;
33549 : }
33550 : ret = 0;
33551 : done:
33552 : Py_XDECREF(shift);
33553 : Py_XDECREF(mask);
33554 : Py_XDECREF(stepval);
33555 : #endif
33556 : if (unlikely(ret))
33557 : return (int) -1;
33558 : return val;
33559 : }
33560 0 : raise_overflow:
33561 0 : PyErr_SetString(PyExc_OverflowError,
33562 : "value too large to convert to int");
33563 0 : return (int) -1;
33564 : raise_neg_overflow:
33565 : PyErr_SetString(PyExc_OverflowError,
33566 : "can't convert negative value to int");
33567 : return (int) -1;
33568 : }
33569 :
33570 : /* CIntFromPy */
33571 0 : static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
33572 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33573 : #pragma GCC diagnostic push
33574 : #pragma GCC diagnostic ignored "-Wconversion"
33575 : #endif
33576 0 : const long neg_one = (long) -1, const_zero = (long) 0;
33577 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33578 : #pragma GCC diagnostic pop
33579 : #endif
33580 0 : const int is_unsigned = neg_one > const_zero;
33581 : #if PY_MAJOR_VERSION < 3
33582 : if (likely(PyInt_Check(x))) {
33583 : if ((sizeof(long) < sizeof(long))) {
33584 : __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
33585 : } else {
33586 : long val = PyInt_AS_LONG(x);
33587 : if (is_unsigned && unlikely(val < 0)) {
33588 : goto raise_neg_overflow;
33589 : }
33590 : return (long) val;
33591 : }
33592 : }
33593 : #endif
33594 0 : if (unlikely(!PyLong_Check(x))) {
33595 0 : long val;
33596 0 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
33597 0 : if (!tmp) return (long) -1;
33598 0 : val = __Pyx_PyInt_As_long(tmp);
33599 0 : Py_DECREF(tmp);
33600 0 : return val;
33601 : }
33602 0 : if (is_unsigned) {
33603 : #if CYTHON_USE_PYLONG_INTERNALS
33604 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
33605 : goto raise_neg_overflow;
33606 : } else if (__Pyx_PyLong_IsCompact(x)) {
33607 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
33608 : } else {
33609 : const digit* digits = __Pyx_PyLong_Digits(x);
33610 : assert(__Pyx_PyLong_DigitCount(x) > 1);
33611 : switch (__Pyx_PyLong_DigitCount(x)) {
33612 : case 2:
33613 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
33614 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33615 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33616 : } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
33617 : return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33618 : }
33619 : }
33620 : break;
33621 : case 3:
33622 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33623 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33624 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33625 : } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
33626 : return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33627 : }
33628 : }
33629 : break;
33630 : case 4:
33631 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33632 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33633 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33634 : } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
33635 : return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
33636 : }
33637 : }
33638 : break;
33639 : }
33640 : }
33641 : #endif
33642 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
33643 : if (unlikely(Py_SIZE(x) < 0)) {
33644 : goto raise_neg_overflow;
33645 : }
33646 : #else
33647 : {
33648 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
33649 : if (unlikely(result < 0))
33650 : return (long) -1;
33651 : if (unlikely(result == 1))
33652 : goto raise_neg_overflow;
33653 : }
33654 : #endif
33655 : if ((sizeof(long) <= sizeof(unsigned long))) {
33656 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
33657 : #ifdef HAVE_LONG_LONG
33658 : } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
33659 : __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
33660 : #endif
33661 : }
33662 : } else {
33663 : #if CYTHON_USE_PYLONG_INTERNALS
33664 0 : if (__Pyx_PyLong_IsCompact(x)) {
33665 0 : __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
33666 : } else {
33667 0 : const digit* digits = __Pyx_PyLong_Digits(x);
33668 0 : assert(__Pyx_PyLong_DigitCount(x) > 1);
33669 0 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
33670 : case -2:
33671 0 : if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
33672 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33673 0 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33674 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
33675 : return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33676 : }
33677 : }
33678 : break;
33679 : case 2:
33680 0 : if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
33681 0 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
33682 0 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33683 : } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
33684 : return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33685 : }
33686 : }
33687 : break;
33688 : case -3:
33689 : if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
33690 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33691 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33692 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
33693 : return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33694 : }
33695 : }
33696 : break;
33697 : case 3:
33698 : if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
33699 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
33700 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33701 : } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
33702 : return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33703 : }
33704 : }
33705 : break;
33706 : case -4:
33707 : if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
33708 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33709 : __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33710 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
33711 : return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33712 : }
33713 : }
33714 : break;
33715 : case 4:
33716 : if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
33717 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
33718 : __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
33719 : } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
33720 : return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
33721 : }
33722 : }
33723 : break;
33724 : }
33725 : }
33726 : #endif
33727 0 : if ((sizeof(long) <= sizeof(long))) {
33728 0 : __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
33729 : #ifdef HAVE_LONG_LONG
33730 : } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
33731 : __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
33732 : #endif
33733 : }
33734 : }
33735 : {
33736 : long val;
33737 : int ret = -1;
33738 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
33739 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
33740 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
33741 : if (unlikely(bytes_copied == -1)) {
33742 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
33743 : goto raise_overflow;
33744 : } else {
33745 : ret = 0;
33746 : }
33747 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
33748 : int one = 1; int is_little = (int)*(unsigned char *)&one;
33749 : unsigned char *bytes = (unsigned char *)&val;
33750 : ret = _PyLong_AsByteArray((PyLongObject *)x,
33751 : bytes, sizeof(val),
33752 : is_little, !is_unsigned);
33753 : #else
33754 : PyObject *v;
33755 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
33756 : int bits, remaining_bits, is_negative = 0;
33757 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
33758 : if (likely(PyLong_CheckExact(x))) {
33759 : v = __Pyx_NewRef(x);
33760 : } else {
33761 : v = PyNumber_Long(x);
33762 : if (unlikely(!v)) return (long) -1;
33763 : assert(PyLong_CheckExact(v));
33764 : }
33765 : {
33766 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
33767 : if (unlikely(result < 0)) {
33768 : Py_DECREF(v);
33769 : return (long) -1;
33770 : }
33771 : is_negative = result == 1;
33772 : }
33773 : if (is_unsigned && unlikely(is_negative)) {
33774 : Py_DECREF(v);
33775 : goto raise_neg_overflow;
33776 : } else if (is_negative) {
33777 : stepval = PyNumber_Invert(v);
33778 : Py_DECREF(v);
33779 : if (unlikely(!stepval))
33780 : return (long) -1;
33781 : } else {
33782 : stepval = v;
33783 : }
33784 : v = NULL;
33785 : val = (long) 0;
33786 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
33787 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
33788 : for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
33789 : PyObject *tmp, *digit;
33790 : long idigit;
33791 : digit = PyNumber_And(stepval, mask);
33792 : if (unlikely(!digit)) goto done;
33793 : idigit = PyLong_AsLong(digit);
33794 : Py_DECREF(digit);
33795 : if (unlikely(idigit < 0)) goto done;
33796 : val |= ((long) idigit) << bits;
33797 : tmp = PyNumber_Rshift(stepval, shift);
33798 : if (unlikely(!tmp)) goto done;
33799 : Py_DECREF(stepval); stepval = tmp;
33800 : }
33801 : Py_DECREF(shift); shift = NULL;
33802 : Py_DECREF(mask); mask = NULL;
33803 : {
33804 : long idigit = PyLong_AsLong(stepval);
33805 : if (unlikely(idigit < 0)) goto done;
33806 : remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
33807 : if (unlikely(idigit >= (1L << remaining_bits)))
33808 : goto raise_overflow;
33809 : val |= ((long) idigit) << bits;
33810 : }
33811 : if (!is_unsigned) {
33812 : if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
33813 : goto raise_overflow;
33814 : if (is_negative)
33815 : val = ~val;
33816 : }
33817 : ret = 0;
33818 : done:
33819 : Py_XDECREF(shift);
33820 : Py_XDECREF(mask);
33821 : Py_XDECREF(stepval);
33822 : #endif
33823 : if (unlikely(ret))
33824 : return (long) -1;
33825 : return val;
33826 : }
33827 : raise_overflow:
33828 : PyErr_SetString(PyExc_OverflowError,
33829 : "value too large to convert to long");
33830 : return (long) -1;
33831 : raise_neg_overflow:
33832 : PyErr_SetString(PyExc_OverflowError,
33833 : "can't convert negative value to long");
33834 : return (long) -1;
33835 : }
33836 :
33837 : /* CIntToPy */
33838 636 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
33839 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33840 : #pragma GCC diagnostic push
33841 : #pragma GCC diagnostic ignored "-Wconversion"
33842 : #endif
33843 636 : const int neg_one = (int) -1, const_zero = (int) 0;
33844 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33845 : #pragma GCC diagnostic pop
33846 : #endif
33847 636 : const int is_unsigned = neg_one > const_zero;
33848 636 : if (is_unsigned) {
33849 : if (sizeof(int) < sizeof(long)) {
33850 : return PyInt_FromLong((long) value);
33851 : } else if (sizeof(int) <= sizeof(unsigned long)) {
33852 : return PyLong_FromUnsignedLong((unsigned long) value);
33853 : #ifdef HAVE_LONG_LONG
33854 : } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
33855 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
33856 : #endif
33857 : }
33858 : } else {
33859 636 : if (sizeof(int) <= sizeof(long)) {
33860 636 : return PyInt_FromLong((long) value);
33861 : #ifdef HAVE_LONG_LONG
33862 : } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
33863 : return PyLong_FromLongLong((PY_LONG_LONG) value);
33864 : #endif
33865 : }
33866 : }
33867 : {
33868 : unsigned char *bytes = (unsigned char *)&value;
33869 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
33870 : if (is_unsigned) {
33871 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
33872 : } else {
33873 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
33874 : }
33875 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
33876 : int one = 1; int little = (int)*(unsigned char *)&one;
33877 : return _PyLong_FromByteArray(bytes, sizeof(int),
33878 : little, !is_unsigned);
33879 : #else
33880 : int one = 1; int little = (int)*(unsigned char *)&one;
33881 : PyObject *from_bytes, *result = NULL;
33882 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
33883 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
33884 : if (!from_bytes) return NULL;
33885 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
33886 : if (!py_bytes) goto limited_bad;
33887 : order_str = PyUnicode_FromString(little ? "little" : "big");
33888 : if (!order_str) goto limited_bad;
33889 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
33890 : if (!arg_tuple) goto limited_bad;
33891 : if (!is_unsigned) {
33892 : kwds = PyDict_New();
33893 : if (!kwds) goto limited_bad;
33894 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
33895 : }
33896 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
33897 : limited_bad:
33898 : Py_XDECREF(kwds);
33899 : Py_XDECREF(arg_tuple);
33900 : Py_XDECREF(order_str);
33901 : Py_XDECREF(py_bytes);
33902 : Py_XDECREF(from_bytes);
33903 : return result;
33904 : #endif
33905 : }
33906 : }
33907 :
33908 : /* CIntToPy */
33909 0 : static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
33910 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33911 : #pragma GCC diagnostic push
33912 : #pragma GCC diagnostic ignored "-Wconversion"
33913 : #endif
33914 0 : const long neg_one = (long) -1, const_zero = (long) 0;
33915 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33916 : #pragma GCC diagnostic pop
33917 : #endif
33918 0 : const int is_unsigned = neg_one > const_zero;
33919 0 : if (is_unsigned) {
33920 : if (sizeof(long) < sizeof(long)) {
33921 : return PyInt_FromLong((long) value);
33922 : } else if (sizeof(long) <= sizeof(unsigned long)) {
33923 : return PyLong_FromUnsignedLong((unsigned long) value);
33924 : #ifdef HAVE_LONG_LONG
33925 : } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
33926 : return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
33927 : #endif
33928 : }
33929 : } else {
33930 0 : if (sizeof(long) <= sizeof(long)) {
33931 0 : return PyInt_FromLong((long) value);
33932 : #ifdef HAVE_LONG_LONG
33933 : } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
33934 : return PyLong_FromLongLong((PY_LONG_LONG) value);
33935 : #endif
33936 : }
33937 : }
33938 : {
33939 : unsigned char *bytes = (unsigned char *)&value;
33940 : #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
33941 : if (is_unsigned) {
33942 : return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
33943 : } else {
33944 : return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
33945 : }
33946 : #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
33947 : int one = 1; int little = (int)*(unsigned char *)&one;
33948 : return _PyLong_FromByteArray(bytes, sizeof(long),
33949 : little, !is_unsigned);
33950 : #else
33951 : int one = 1; int little = (int)*(unsigned char *)&one;
33952 : PyObject *from_bytes, *result = NULL;
33953 : PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
33954 : from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
33955 : if (!from_bytes) return NULL;
33956 : py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
33957 : if (!py_bytes) goto limited_bad;
33958 : order_str = PyUnicode_FromString(little ? "little" : "big");
33959 : if (!order_str) goto limited_bad;
33960 : arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
33961 : if (!arg_tuple) goto limited_bad;
33962 : if (!is_unsigned) {
33963 : kwds = PyDict_New();
33964 : if (!kwds) goto limited_bad;
33965 : if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
33966 : }
33967 : result = PyObject_Call(from_bytes, arg_tuple, kwds);
33968 : limited_bad:
33969 : Py_XDECREF(kwds);
33970 : Py_XDECREF(arg_tuple);
33971 : Py_XDECREF(order_str);
33972 : Py_XDECREF(py_bytes);
33973 : Py_XDECREF(from_bytes);
33974 : return result;
33975 : #endif
33976 : }
33977 : }
33978 :
33979 : /* CIntFromPy */
33980 : static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
33981 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33982 : #pragma GCC diagnostic push
33983 : #pragma GCC diagnostic ignored "-Wconversion"
33984 : #endif
33985 : const char neg_one = (char) -1, const_zero = (char) 0;
33986 : #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
33987 : #pragma GCC diagnostic pop
33988 : #endif
33989 : const int is_unsigned = neg_one > const_zero;
33990 : #if PY_MAJOR_VERSION < 3
33991 : if (likely(PyInt_Check(x))) {
33992 : if ((sizeof(char) < sizeof(long))) {
33993 : __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
33994 : } else {
33995 : long val = PyInt_AS_LONG(x);
33996 : if (is_unsigned && unlikely(val < 0)) {
33997 : goto raise_neg_overflow;
33998 : }
33999 : return (char) val;
34000 : }
34001 : }
34002 : #endif
34003 : if (unlikely(!PyLong_Check(x))) {
34004 : char val;
34005 : PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
34006 : if (!tmp) return (char) -1;
34007 : val = __Pyx_PyInt_As_char(tmp);
34008 : Py_DECREF(tmp);
34009 : return val;
34010 : }
34011 : if (is_unsigned) {
34012 : #if CYTHON_USE_PYLONG_INTERNALS
34013 : if (unlikely(__Pyx_PyLong_IsNeg(x))) {
34014 : goto raise_neg_overflow;
34015 : } else if (__Pyx_PyLong_IsCompact(x)) {
34016 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
34017 : } else {
34018 : const digit* digits = __Pyx_PyLong_Digits(x);
34019 : assert(__Pyx_PyLong_DigitCount(x) > 1);
34020 : switch (__Pyx_PyLong_DigitCount(x)) {
34021 : case 2:
34022 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
34023 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34024 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34025 : } else if ((8 * sizeof(char) >= 2 * PyLong_SHIFT)) {
34026 : return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
34027 : }
34028 : }
34029 : break;
34030 : case 3:
34031 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
34032 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34033 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34034 : } else if ((8 * sizeof(char) >= 3 * PyLong_SHIFT)) {
34035 : return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
34036 : }
34037 : }
34038 : break;
34039 : case 4:
34040 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
34041 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34042 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34043 : } else if ((8 * sizeof(char) >= 4 * PyLong_SHIFT)) {
34044 : return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
34045 : }
34046 : }
34047 : break;
34048 : }
34049 : }
34050 : #endif
34051 : #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
34052 : if (unlikely(Py_SIZE(x) < 0)) {
34053 : goto raise_neg_overflow;
34054 : }
34055 : #else
34056 : {
34057 : int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
34058 : if (unlikely(result < 0))
34059 : return (char) -1;
34060 : if (unlikely(result == 1))
34061 : goto raise_neg_overflow;
34062 : }
34063 : #endif
34064 : if ((sizeof(char) <= sizeof(unsigned long))) {
34065 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
34066 : #ifdef HAVE_LONG_LONG
34067 : } else if ((sizeof(char) <= sizeof(unsigned PY_LONG_LONG))) {
34068 : __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
34069 : #endif
34070 : }
34071 : } else {
34072 : #if CYTHON_USE_PYLONG_INTERNALS
34073 : if (__Pyx_PyLong_IsCompact(x)) {
34074 : __PYX_VERIFY_RETURN_INT(char, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
34075 : } else {
34076 : const digit* digits = __Pyx_PyLong_Digits(x);
34077 : assert(__Pyx_PyLong_DigitCount(x) > 1);
34078 : switch (__Pyx_PyLong_SignedDigitCount(x)) {
34079 : case -2:
34080 : if ((8 * sizeof(char) - 1 > 1 * PyLong_SHIFT)) {
34081 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34082 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34083 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
34084 : return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34085 : }
34086 : }
34087 : break;
34088 : case 2:
34089 : if ((8 * sizeof(char) > 1 * PyLong_SHIFT)) {
34090 : if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
34091 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34092 : } else if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
34093 : return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34094 : }
34095 : }
34096 : break;
34097 : case -3:
34098 : if ((8 * sizeof(char) - 1 > 2 * PyLong_SHIFT)) {
34099 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34100 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34101 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
34102 : return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34103 : }
34104 : }
34105 : break;
34106 : case 3:
34107 : if ((8 * sizeof(char) > 2 * PyLong_SHIFT)) {
34108 : if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
34109 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34110 : } else if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
34111 : return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34112 : }
34113 : }
34114 : break;
34115 : case -4:
34116 : if ((8 * sizeof(char) - 1 > 3 * PyLong_SHIFT)) {
34117 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34118 : __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34119 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
34120 : return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34121 : }
34122 : }
34123 : break;
34124 : case 4:
34125 : if ((8 * sizeof(char) > 3 * PyLong_SHIFT)) {
34126 : if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
34127 : __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
34128 : } else if ((8 * sizeof(char) - 1 > 4 * PyLong_SHIFT)) {
34129 : return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
34130 : }
34131 : }
34132 : break;
34133 : }
34134 : }
34135 : #endif
34136 : if ((sizeof(char) <= sizeof(long))) {
34137 : __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
34138 : #ifdef HAVE_LONG_LONG
34139 : } else if ((sizeof(char) <= sizeof(PY_LONG_LONG))) {
34140 : __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
34141 : #endif
34142 : }
34143 : }
34144 : {
34145 : char val;
34146 : int ret = -1;
34147 : #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
34148 : Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
34149 : x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
34150 : if (unlikely(bytes_copied == -1)) {
34151 : } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
34152 : goto raise_overflow;
34153 : } else {
34154 : ret = 0;
34155 : }
34156 : #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
34157 : int one = 1; int is_little = (int)*(unsigned char *)&one;
34158 : unsigned char *bytes = (unsigned char *)&val;
34159 : ret = _PyLong_AsByteArray((PyLongObject *)x,
34160 : bytes, sizeof(val),
34161 : is_little, !is_unsigned);
34162 : #else
34163 : PyObject *v;
34164 : PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
34165 : int bits, remaining_bits, is_negative = 0;
34166 : int chunk_size = (sizeof(long) < 8) ? 30 : 62;
34167 : if (likely(PyLong_CheckExact(x))) {
34168 : v = __Pyx_NewRef(x);
34169 : } else {
34170 : v = PyNumber_Long(x);
34171 : if (unlikely(!v)) return (char) -1;
34172 : assert(PyLong_CheckExact(v));
34173 : }
34174 : {
34175 : int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
34176 : if (unlikely(result < 0)) {
34177 : Py_DECREF(v);
34178 : return (char) -1;
34179 : }
34180 : is_negative = result == 1;
34181 : }
34182 : if (is_unsigned && unlikely(is_negative)) {
34183 : Py_DECREF(v);
34184 : goto raise_neg_overflow;
34185 : } else if (is_negative) {
34186 : stepval = PyNumber_Invert(v);
34187 : Py_DECREF(v);
34188 : if (unlikely(!stepval))
34189 : return (char) -1;
34190 : } else {
34191 : stepval = v;
34192 : }
34193 : v = NULL;
34194 : val = (char) 0;
34195 : mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
34196 : shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
34197 : for (bits = 0; bits < (int) sizeof(char) * 8 - chunk_size; bits += chunk_size) {
34198 : PyObject *tmp, *digit;
34199 : long idigit;
34200 : digit = PyNumber_And(stepval, mask);
34201 : if (unlikely(!digit)) goto done;
34202 : idigit = PyLong_AsLong(digit);
34203 : Py_DECREF(digit);
34204 : if (unlikely(idigit < 0)) goto done;
34205 : val |= ((char) idigit) << bits;
34206 : tmp = PyNumber_Rshift(stepval, shift);
34207 : if (unlikely(!tmp)) goto done;
34208 : Py_DECREF(stepval); stepval = tmp;
34209 : }
34210 : Py_DECREF(shift); shift = NULL;
34211 : Py_DECREF(mask); mask = NULL;
34212 : {
34213 : long idigit = PyLong_AsLong(stepval);
34214 : if (unlikely(idigit < 0)) goto done;
34215 : remaining_bits = ((int) sizeof(char) * 8) - bits - (is_unsigned ? 0 : 1);
34216 : if (unlikely(idigit >= (1L << remaining_bits)))
34217 : goto raise_overflow;
34218 : val |= ((char) idigit) << bits;
34219 : }
34220 : if (!is_unsigned) {
34221 : if (unlikely(val & (((char) 1) << (sizeof(char) * 8 - 1))))
34222 : goto raise_overflow;
34223 : if (is_negative)
34224 : val = ~val;
34225 : }
34226 : ret = 0;
34227 : done:
34228 : Py_XDECREF(shift);
34229 : Py_XDECREF(mask);
34230 : Py_XDECREF(stepval);
34231 : #endif
34232 : if (unlikely(ret))
34233 : return (char) -1;
34234 : return val;
34235 : }
34236 : raise_overflow:
34237 : PyErr_SetString(PyExc_OverflowError,
34238 : "value too large to convert to char");
34239 : return (char) -1;
34240 : raise_neg_overflow:
34241 : PyErr_SetString(PyExc_OverflowError,
34242 : "can't convert negative value to char");
34243 : return (char) -1;
34244 : }
34245 :
34246 : /* FormatTypeName */
34247 : #if CYTHON_COMPILING_IN_LIMITED_API
34248 : static __Pyx_TypeName
34249 : __Pyx_PyType_GetName(PyTypeObject* tp)
34250 : {
34251 : PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
34252 : __pyx_n_s_name_2);
34253 : if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
34254 : PyErr_Clear();
34255 : Py_XDECREF(name);
34256 : name = __Pyx_NewRef(__pyx_n_s__34);
34257 : }
34258 : return name;
34259 : }
34260 : #endif
34261 :
34262 : /* CheckBinaryVersion */
34263 3 : static unsigned long __Pyx_get_runtime_version(void) {
34264 : #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
34265 3 : return Py_Version & ~0xFFUL;
34266 : #else
34267 : const char* rt_version = Py_GetVersion();
34268 : unsigned long version = 0;
34269 : unsigned long factor = 0x01000000UL;
34270 : unsigned int digit = 0;
34271 : int i = 0;
34272 : while (factor) {
34273 : while ('0' <= rt_version[i] && rt_version[i] <= '9') {
34274 : digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
34275 : ++i;
34276 : }
34277 : version += factor * digit;
34278 : if (rt_version[i] != '.')
34279 : break;
34280 : digit = 0;
34281 : factor >>= 8;
34282 : ++i;
34283 : }
34284 : return version;
34285 : #endif
34286 : }
34287 3 : static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
34288 3 : const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
34289 3 : if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
34290 : return 0;
34291 0 : if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
34292 : return 1;
34293 : {
34294 0 : char message[200];
34295 0 : PyOS_snprintf(message, sizeof(message),
34296 : "compile time Python version %d.%d "
34297 : "of module '%.100s' "
34298 : "%s "
34299 : "runtime version %d.%d",
34300 0 : (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
34301 : __Pyx_MODULE_NAME,
34302 : (allow_newer) ? "was newer than" : "does not match",
34303 0 : (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
34304 : );
34305 0 : return PyErr_WarnEx(NULL, message, 1);
34306 : }
34307 : }
34308 :
34309 : /* InitStrings */
34310 : #if PY_MAJOR_VERSION >= 3
34311 603 : static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
34312 603 : if (t.is_unicode | t.is_str) {
34313 600 : if (t.intern) {
34314 447 : *str = PyUnicode_InternFromString(t.s);
34315 153 : } else if (t.encoding) {
34316 0 : *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
34317 : } else {
34318 153 : *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
34319 : }
34320 : } else {
34321 3 : *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
34322 : }
34323 603 : if (!*str)
34324 : return -1;
34325 603 : if (PyObject_Hash(*str) == -1)
34326 : return -1;
34327 : return 0;
34328 : }
34329 : #endif
34330 3 : static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
34331 606 : while (t->p) {
34332 : #if PY_MAJOR_VERSION >= 3
34333 603 : __Pyx_InitString(*t, t->p);
34334 : #else
34335 : if (t->is_unicode) {
34336 : *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
34337 : } else if (t->intern) {
34338 : *t->p = PyString_InternFromString(t->s);
34339 : } else {
34340 : *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
34341 : }
34342 : if (!*t->p)
34343 : return -1;
34344 : if (PyObject_Hash(*t->p) == -1)
34345 : return -1;
34346 : #endif
34347 603 : ++t;
34348 : }
34349 3 : return 0;
34350 : }
34351 :
34352 : #include <string.h>
34353 0 : static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
34354 0 : size_t len = strlen(s);
34355 0 : if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
34356 : PyErr_SetString(PyExc_OverflowError, "byte string is too long");
34357 : return -1;
34358 : }
34359 : return (Py_ssize_t) len;
34360 : }
34361 : static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
34362 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
34363 : if (unlikely(len < 0)) return NULL;
34364 : return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
34365 : }
34366 : static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
34367 : Py_ssize_t len = __Pyx_ssize_strlen(c_str);
34368 : if (unlikely(len < 0)) return NULL;
34369 : return PyByteArray_FromStringAndSize(c_str, len);
34370 : }
34371 : static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
34372 : Py_ssize_t ignore;
34373 : return __Pyx_PyObject_AsStringAndSize(o, &ignore);
34374 : }
34375 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
34376 : #if !CYTHON_PEP393_ENABLED
34377 : static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34378 : char* defenc_c;
34379 : PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
34380 : if (!defenc) return NULL;
34381 : defenc_c = PyBytes_AS_STRING(defenc);
34382 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34383 : {
34384 : char* end = defenc_c + PyBytes_GET_SIZE(defenc);
34385 : char* c;
34386 : for (c = defenc_c; c < end; c++) {
34387 : if ((unsigned char) (*c) >= 128) {
34388 : PyUnicode_AsASCIIString(o);
34389 : return NULL;
34390 : }
34391 : }
34392 : }
34393 : #endif
34394 : *length = PyBytes_GET_SIZE(defenc);
34395 : return defenc_c;
34396 : }
34397 : #else
34398 : static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34399 : if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
34400 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34401 : if (likely(PyUnicode_IS_ASCII(o))) {
34402 : *length = PyUnicode_GET_LENGTH(o);
34403 : return PyUnicode_AsUTF8(o);
34404 : } else {
34405 : PyUnicode_AsASCIIString(o);
34406 : return NULL;
34407 : }
34408 : #else
34409 : return PyUnicode_AsUTF8AndSize(o, length);
34410 : #endif
34411 : }
34412 : #endif
34413 : #endif
34414 : static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
34415 : #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
34416 : if (
34417 : #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
34418 : __Pyx_sys_getdefaultencoding_not_ascii &&
34419 : #endif
34420 : PyUnicode_Check(o)) {
34421 : return __Pyx_PyUnicode_AsStringAndSize(o, length);
34422 : } else
34423 : #endif
34424 : #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
34425 : if (PyByteArray_Check(o)) {
34426 : *length = PyByteArray_GET_SIZE(o);
34427 : return PyByteArray_AS_STRING(o);
34428 : } else
34429 : #endif
34430 : {
34431 : char* result;
34432 : int r = PyBytes_AsStringAndSize(o, &result, length);
34433 : if (unlikely(r < 0)) {
34434 : return NULL;
34435 : } else {
34436 : return result;
34437 : }
34438 : }
34439 : }
34440 1078 : static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
34441 1078 : int is_true = x == Py_True;
34442 1078 : if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
34443 3 : else return PyObject_IsTrue(x);
34444 : }
34445 : static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
34446 : int retval;
34447 : if (unlikely(!x)) return -1;
34448 : retval = __Pyx_PyObject_IsTrue(x);
34449 : Py_DECREF(x);
34450 : return retval;
34451 : }
34452 0 : static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
34453 0 : __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
34454 : #if PY_MAJOR_VERSION >= 3
34455 0 : if (PyLong_Check(result)) {
34456 0 : if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
34457 : "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
34458 : "The ability to return an instance of a strict subclass of int is deprecated, "
34459 : "and may be removed in a future version of Python.",
34460 : result_type_name)) {
34461 0 : __Pyx_DECREF_TypeName(result_type_name);
34462 0 : Py_DECREF(result);
34463 0 : return NULL;
34464 : }
34465 : __Pyx_DECREF_TypeName(result_type_name);
34466 : return result;
34467 : }
34468 : #endif
34469 0 : PyErr_Format(PyExc_TypeError,
34470 : "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
34471 : type_name, type_name, result_type_name);
34472 0 : __Pyx_DECREF_TypeName(result_type_name);
34473 0 : Py_DECREF(result);
34474 : return NULL;
34475 : }
34476 9 : static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
34477 : #if CYTHON_USE_TYPE_SLOTS
34478 9 : PyNumberMethods *m;
34479 : #endif
34480 9 : const char *name = NULL;
34481 9 : PyObject *res = NULL;
34482 : #if PY_MAJOR_VERSION < 3
34483 : if (likely(PyInt_Check(x) || PyLong_Check(x)))
34484 : #else
34485 9 : if (likely(PyLong_Check(x)))
34486 : #endif
34487 0 : return __Pyx_NewRef(x);
34488 : #if CYTHON_USE_TYPE_SLOTS
34489 9 : m = Py_TYPE(x)->tp_as_number;
34490 : #if PY_MAJOR_VERSION < 3
34491 : if (m && m->nb_int) {
34492 : name = "int";
34493 : res = m->nb_int(x);
34494 : }
34495 : else if (m && m->nb_long) {
34496 : name = "long";
34497 : res = m->nb_long(x);
34498 : }
34499 : #else
34500 9 : if (likely(m && m->nb_int)) {
34501 9 : name = "int";
34502 9 : res = m->nb_int(x);
34503 : }
34504 : #endif
34505 : #else
34506 : if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
34507 : res = PyNumber_Int(x);
34508 : }
34509 : #endif
34510 9 : if (likely(res)) {
34511 : #if PY_MAJOR_VERSION < 3
34512 : if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
34513 : #else
34514 9 : if (unlikely(!PyLong_CheckExact(res))) {
34515 : #endif
34516 0 : return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
34517 : }
34518 : }
34519 0 : else if (!PyErr_Occurred()) {
34520 0 : PyErr_SetString(PyExc_TypeError,
34521 : "an integer is required");
34522 : }
34523 : return res;
34524 : }
34525 430 : static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
34526 430 : Py_ssize_t ival;
34527 430 : PyObject *x;
34528 : #if PY_MAJOR_VERSION < 3
34529 : if (likely(PyInt_CheckExact(b))) {
34530 : if (sizeof(Py_ssize_t) >= sizeof(long))
34531 : return PyInt_AS_LONG(b);
34532 : else
34533 : return PyInt_AsSsize_t(b);
34534 : }
34535 : #endif
34536 430 : if (likely(PyLong_CheckExact(b))) {
34537 : #if CYTHON_USE_PYLONG_INTERNALS
34538 430 : if (likely(__Pyx_PyLong_IsCompact(b))) {
34539 430 : return __Pyx_PyLong_CompactValue(b);
34540 : } else {
34541 0 : const digit* digits = __Pyx_PyLong_Digits(b);
34542 0 : const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
34543 0 : switch (size) {
34544 : case 2:
34545 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
34546 0 : return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34547 : }
34548 : break;
34549 : case -2:
34550 0 : if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
34551 0 : return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34552 : }
34553 : break;
34554 : case 3:
34555 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
34556 : return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34557 : }
34558 : break;
34559 : case -3:
34560 : if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
34561 : return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34562 : }
34563 : break;
34564 : case 4:
34565 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
34566 : return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34567 : }
34568 : break;
34569 : case -4:
34570 : if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
34571 : return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
34572 : }
34573 : break;
34574 : }
34575 : }
34576 : #endif
34577 0 : return PyLong_AsSsize_t(b);
34578 : }
34579 0 : x = PyNumber_Index(b);
34580 0 : if (!x) return -1;
34581 0 : ival = PyInt_AsSsize_t(x);
34582 0 : Py_DECREF(x);
34583 : return ival;
34584 : }
34585 : static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
34586 : if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
34587 : return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
34588 : #if PY_MAJOR_VERSION < 3
34589 : } else if (likely(PyInt_CheckExact(o))) {
34590 : return PyInt_AS_LONG(o);
34591 : #endif
34592 : } else {
34593 : Py_ssize_t ival;
34594 : PyObject *x;
34595 : x = PyNumber_Index(o);
34596 : if (!x) return -1;
34597 : ival = PyInt_AsLong(x);
34598 : Py_DECREF(x);
34599 : return ival;
34600 : }
34601 : }
34602 1066 : static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
34603 1066 : return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
34604 : }
34605 : static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
34606 : return PyInt_FromSize_t(ival);
34607 : }
34608 :
34609 :
34610 : /* #### Code section: utility_code_pragmas_end ### */
34611 : #ifdef _MSC_VER
34612 : #pragma warning( pop )
34613 : #endif
34614 :
34615 :
34616 :
34617 : /* #### Code section: end ### */
34618 : #endif /* Py_PYTHON_H */
|